From 1c39df369819837a1d86b5e017cc817a8aed49ea Mon Sep 17 00:00:00 2001 From: Francia Csaba Date: Wed, 21 Feb 2024 12:50:32 +0100 Subject: [PATCH] Added route colors to Trip class --- amarillo/plugins/enhancer/services/trips.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/amarillo/plugins/enhancer/services/trips.py b/amarillo/plugins/enhancer/services/trips.py index 6faa749..006076f 100644 --- a/amarillo/plugins/enhancer/services/trips.py +++ b/amarillo/plugins/enhancer/services/trips.py @@ -17,7 +17,7 @@ logger = logging.getLogger(__name__) class Trip: - def __init__(self, trip_id, route_name, headsign, url, calendar, departureTime, path, agency, lastUpdated, stop_times, driver: Driver, additional_ridesharing_info: RidesharingInfo, bbox): + def __init__(self, trip_id, route_name, headsign, url, calendar, departureTime, path, agency, lastUpdated, stop_times, driver: Driver, additional_ridesharing_info: RidesharingInfo, route_color, route_text_color, bbox): if isinstance(calendar, set): self.runs_regularly = True self.weekdays = [ @@ -45,6 +45,8 @@ class Trip: self.stop_times = stop_times self.driver = driver self.additional_ridesharing_info = additional_ridesharing_info + self.route_color = route_color + self.route_text_color = route_text_color self.bbox = bbox self.route_name = route_name self.trip_headsign = headsign @@ -217,7 +219,7 @@ class TripTransformer: max([pt[0] for pt in path.coordinates]), max([pt[1] for pt in path.coordinates])) - trip = Trip(trip_id, route_name, headsign, str(carpool.deeplink), carpool.departureDate, carpool.departureTime, carpool.path, carpool.agency, carpool.lastUpdated, stop_times, carpool.driver, carpool.additional_ridesharing_info, bbox) + trip = Trip(trip_id, route_name, headsign, str(carpool.deeplink), carpool.departureDate, carpool.departureTime, carpool.path, carpool.agency, carpool.lastUpdated, stop_times, carpool.driver, carpool.additional_ridesharing_info, carpool.route_color, carpool.route_text_color, bbox) return trip