diff --git a/amarillo/plugins/enhancer/configuration.py b/amarillo/plugins/enhancer/configuration.py index 821e365..dec2e88 100644 --- a/amarillo/plugins/enhancer/configuration.py +++ b/amarillo/plugins/enhancer/configuration.py @@ -1,16 +1,16 @@ # separate file so that it can be imported without initializing FastAPI -from amarillo.app.utils.container import container +from amarillo.utils.container import container import json import logging from glob import glob -from amarillo.app.models.Carpool import Carpool -from amarillo.app.services import stops +from amarillo.models.Carpool import Carpool +from amarillo.services import stops from amarillo.plugins.enhancer.services import trips from amarillo.plugins.enhancer.services.carpools import CarpoolService from amarillo.plugins.enhancer.services import gtfs_generator -from amarillo.app.configuration import configure_services +from amarillo.configuration import configure_services logger = logging.getLogger(__name__) diff --git a/amarillo/plugins/enhancer/enhancer.py b/amarillo/plugins/enhancer/enhancer.py index 349a76a..30b44e6 100644 --- a/amarillo/plugins/enhancer/enhancer.py +++ b/amarillo/plugins/enhancer/enhancer.py @@ -6,10 +6,9 @@ from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler from amarillo.plugins.enhancer.configuration import configure_enhancer_services -from amarillo.app.utils.container import container -from amarillo.app.models.Carpool import Carpool -from amarillo.app.utils.utils import agency_carpool_ids_from_filename -from amarillo.plugins.enhancer.services.export_router import export_router +from amarillo.utils.container import container +from amarillo.models.Carpool import Carpool +from amarillo.utils.utils import agency_carpool_ids_from_filename logging.config.fileConfig('logging.conf', disable_existing_loggers=False) logger = logging.getLogger("enhancer") @@ -71,8 +70,6 @@ def run_enhancer(): logger.info("Goodbye Enhancer") def setup(app): - app.include_router(export_router) - thread = Thread(target=run_enhancer) thread.start() diff --git a/amarillo/plugins/enhancer/services/carpools.py b/amarillo/plugins/enhancer/services/carpools.py index 5d6b97c..e62d7fd 100644 --- a/amarillo/plugins/enhancer/services/carpools.py +++ b/amarillo/plugins/enhancer/services/carpools.py @@ -2,8 +2,8 @@ import json import logging from datetime import datetime from typing import Dict -from amarillo.app.models.Carpool import Carpool -from amarillo.app.utils.utils import yesterday, is_older_than_days +from amarillo.models.Carpool import Carpool +from amarillo.utils.utils import yesterday, is_older_than_days logger = logging.getLogger(__name__) diff --git a/amarillo/plugins/enhancer/services/gtfs_export.py b/amarillo/plugins/enhancer/services/gtfs_export.py index 3f3a277..49aefe3 100644 --- a/amarillo/plugins/enhancer/services/gtfs_export.py +++ b/amarillo/plugins/enhancer/services/gtfs_export.py @@ -7,12 +7,12 @@ import gettext import logging import re -from amarillo.app.utils.utils import assert_folder_exists -from amarillo.app.models.gtfs import GtfsTimeDelta, GtfsFeedInfo, GtfsAgency, GtfsRoute, GtfsStop, GtfsTrip, GtfsCalendar, GtfsCalendarDate, GtfsShape, GtfsDriver, GtfsAdditionalRidesharingInfo -from amarillo.app.models.Carpool import Driver, RidesharingInfo -from amarillo.app.services.stops import is_carpooling_stop -from amarillo.app.services.gtfs_constants import * -from amarillo.app.utils.utils import geodesic_distance_in_m +from amarillo.utils.utils import assert_folder_exists +from amarillo.models.gtfs import GtfsTimeDelta, GtfsFeedInfo, GtfsAgency, GtfsRoute, GtfsStop, GtfsTrip, GtfsCalendar, GtfsCalendarDate, GtfsShape, GtfsDriver, GtfsAdditionalRidesharingInfo +from amarillo.models.Carpool import Driver, RidesharingInfo +from amarillo.services.stops import is_carpooling_stop +from amarillo.services.gtfs_constants import * +from amarillo.utils.utils import geodesic_distance_in_m from amarillo.plugins.enhancer.services.trips import Trip diff --git a/amarillo/plugins/enhancer/services/gtfs_generator.py b/amarillo/plugins/enhancer/services/gtfs_generator.py index 604faad..ef1d7d6 100644 --- a/amarillo/plugins/enhancer/services/gtfs_generator.py +++ b/amarillo/plugins/enhancer/services/gtfs_generator.py @@ -1,7 +1,7 @@ -from amarillo.app.models.Carpool import Region +from amarillo.models.Carpool import Region from amarillo.plugins.enhancer.services.gtfs_export import GtfsExport, GtfsFeedInfo, GtfsAgency -from amarillo.app.services.gtfs import GtfsRtProducer -from amarillo.app.utils.container import container +from amarillo.services.gtfs import GtfsRtProducer +from amarillo.utils.container import container from glob import glob import json import schedule diff --git a/amarillo/plugins/enhancer/services/trips.py b/amarillo/plugins/enhancer/services/trips.py index 4e50235..ba32825 100644 --- a/amarillo/plugins/enhancer/services/trips.py +++ b/amarillo/plugins/enhancer/services/trips.py @@ -1,10 +1,10 @@ -from amarillo.app.models.gtfs import GtfsTimeDelta, GtfsStopTime -from amarillo.app.models.Carpool import MAX_STOPS_PER_TRIP, Carpool, Weekday, StopTime, PickupDropoffType -from amarillo.app.services.gtfs_constants import * -from amarillo.app.services.routing import RoutingService, RoutingException -from amarillo.app.services.stops import is_carpooling_stop -from amarillo.app.utils.utils import assert_folder_exists, is_older_than_days, yesterday, geodesic_distance_in_m -from amarillo.app.models.Carpool import Driver, RidesharingInfo +from amarillo.models.gtfs import GtfsTimeDelta, GtfsStopTime +from amarillo.models.Carpool import MAX_STOPS_PER_TRIP, Carpool, Weekday, StopTime, PickupDropoffType +from amarillo.services.gtfs_constants import * +from amarillo.services.routing import RoutingService, RoutingException +from amarillo.services.stops import is_carpooling_stop +from amarillo.utils.utils import assert_folder_exists, is_older_than_days, yesterday, geodesic_distance_in_m +from amarillo.models.Carpool import Driver, RidesharingInfo from shapely.geometry import Point, LineString, box from geojson_pydantic.geometries import LineString as GeoJSONLineString from datetime import datetime, timedelta