buses.py

changeset 80
0773b4e5fd10
parent 77
83cd29dee853
child 81
d389cdabda00
equal deleted inserted replaced
79:ba854da8c424 80:0773b4e5fd10
432 with gtfs_zip.open('stop_times.txt') as file: 432 with gtfs_zip.open('stop_times.txt') as file:
433 row_count = sum(line.count(b'\n') for line in file) 433 row_count = sum(line.count(b'\n') for line in file)
434 with gtfs_zip.open('stop_times.txt') as file: 434 with gtfs_zip.open('stop_times.txt') as file:
435 progress = 0 435 progress = 0
436 for row in read_csv(map(bytes.decode, file)): 436 for row in read_csv(map(bytes.decode, file)):
437 if int(row.get('pickup_type', 0)) and int(row.get('drop_off_type', 0)): 437 if int(row.get('pickup_type', '') or '0') and int(row.get('drop_off_type', '') or '0'):
438 continue 438 continue
439 trip = all_trips[transform_trip_reference(row['trip_id'])] 439 trip = all_trips[transform_trip_reference(row['trip_id'])]
440 arrival_time = read_time(row['arrival_time']) 440 arrival_time = read_time(row['arrival_time'])
441 departure_time = read_time(row['departure_time']) 441 departure_time = read_time(row['departure_time'])
442 stop = bus_stops[row['stop_id']] 442 stop = bus_stops[row['stop_id']]

mercurial