code: def Write(self, outpath):
      "Writes a .zip file in Google Transit format."
      out = zipfile.ZipFile(outpath, mode="w", compression=zipfile.ZIP_DEFLATED)
      for filename, func in [('agency.txt', self.WriteAgency),
                             ('calendar.txt', self.WriteCalendar),
                             ('calendar_dates.txt', self.WriteCalendarDates),
                             ('routes.txt', self.WriteRoutes),
                             ('trips.txt', self.WriteTrips),
                             ('stops.txt', self.WriteStations),
                             ('stop_times.txt', self.WriteStopTimes)]:
        s = cStringIO.StringIO()
        func(s)
        out.writestr(filename, s.getvalue())
      out.close(f Write(self, outpath):
      "Writes a .zip file in Google Transit format."
      out = zipfile.ZipFile(outpath, mode="w", compression=zipfile.ZIP_DEFLATED)
      for filename, func in [('agency.txt', self.WriteAgency),
                             ('calendar.txt', self.WriteCalendar),
                             ('calendar_dates.txt', self.WriteCalendarDates),
                             ('routes.txt', self.WriteRoutes),
                             ('trips.txt', self.WriteTrips),
                             ('stops.txt', self.WriteStations),
                             ('stop_times.txt', self.WriteStopTimes)]:
        s = cStringIO.StringIO()
        func(s)
        out.writestr(filename, s.getvalue())
      out.close()
docs: Writes a .zip file in Google Transit format.