|
16 | 16 |
|
17 | 17 | """Imports Zurich timetables, converting them from DIVA export format
|
18 | 18 | to Google Transit format."""
|
| 19 | +from __future__ import print_function |
19 | 20 |
|
20 | 21 | # This was written before transitfeed.py and we haven't yet found the
|
21 | 22 | # motivation to port it. Please see the examples directory for better
|
@@ -225,8 +226,8 @@ def ImportStations(self, station_file, adv_file):
|
225 | 226 | # Line ids in this file have leading zeroes, remove.
|
226 | 227 | self.stations[station_id].advertised_lines.add(line_id.lstrip("0"))
|
227 | 228 | else:
|
228 |
| - print "Warning, advertised lines file references " \ |
229 |
| - "unknown station, id " + station_id |
| 229 | + print("Warning, advertised lines file references " \ |
| 230 | + "unknown station, id " + station_id) |
230 | 231 |
|
231 | 232 | def ImportRoutes(self, s):
|
232 | 233 | "Imports the rec_lin_ber.mdv file."
|
@@ -360,8 +361,8 @@ def ImportTrips(self, trips_file):
|
360 | 361 | 'FGR_NR', 'FPL_KUERZEL', 'TAGESMERKMAL_NR', 'VB',
|
361 | 362 | 'FRT_HP_AUS', 'HALTEPUNKT_NR_ZIEL', 'FAHRTART_NR']):
|
362 | 363 | if trip_type != '1':
|
363 |
| - print "skipping Trip ", trip_id, line, direction, \ |
364 |
| - dest_station_id, trip_type |
| 364 | + print("skipping Trip ", trip_id, line, direction, \ |
| 365 | + dest_station_id, trip_type) |
365 | 366 | continue # 1=normal, 2=empty, 3=from depot, 4=to depot, 5=other
|
366 | 367 | trip = Trip()
|
367 | 368 | #The trip_id (FRT_FID) field is not unique in the vbz data, as of Dec 2009
|
@@ -442,7 +443,7 @@ def WriteTrips(self, out):
|
442 | 443 | trips.sort()
|
443 | 444 | for (trip_id, trip) in trips:
|
444 | 445 | if (not len(trip.pattern.stops)) or (None in trip.pattern.stops):
|
445 |
| - print "*** Skipping bad trip: ", [trip.id] |
| 446 | + print("*** Skipping bad trip: ", [trip.id]) |
446 | 447 | continue
|
447 | 448 | self.goodTrips[trip_id] = True
|
448 | 449 | headsign = self.stations[trip.pattern.stops[-1]].name
|
@@ -502,7 +503,7 @@ def main(argv):
|
502 | 503 | importer = DivaImporter(ConvertCH1903, options.drop_unadvertised_lines)
|
503 | 504 | importer.Import(options.in_file)
|
504 | 505 | importer.Write(options.out_file)
|
505 |
| - print 'Wrote output to', options.out_file |
| 506 | + print('Wrote output to', options.out_file) |
506 | 507 |
|
507 | 508 |
|
508 | 509 | if __name__ == '__main__':
|
|
0 commit comments