Skip to content

Commit

Permalink
parse int (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
JorgeBillini authored Nov 25, 2024
1 parent aa84493 commit 3efa9f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gtfs_realtime_translators/translators/cta_subway.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def __make_trip_update(cls, _id, prediction):
parsed_prediction_time)
scheduled_interval = cls.__get_scheduled_interval(is_scheduled,
prediction['schInt'])

route_icon = cls.__get_route_icon(prediction['flags'], headsign)
run_number = prediction['rn']
run_number = int(prediction['rn'])

return TripUpdate.create(entity_id=entity_id,
route_id=route_id,
Expand All @@ -80,11 +80,11 @@ def __get_scheduled_interval(cls, is_scheduled, scheduled_interval):
scheduled_interval_seconds = int(scheduled_interval) * 60
return scheduled_interval_seconds
return None

@classmethod
def __get_route_icon(cls, flags, headsign):
if flags and flags.lower() == 'h':
return 'holiday'
return 'holiday'
if headsign and headsign.lower() in ["midway", "o'hare"]:
return 'airport'
return None

0 comments on commit 3efa9f5

Please sign in to comment.