Example #1
0
    def __init__(self,
                 context,
                 name,
                 zmq_socket,
                 realtime_proxies_configuration=[]):
        self.geom = None
        self._sockets = queue.Queue()
        self.socket_path = zmq_socket
        self._scenario = None
        self._scenario_name = None
        self.nb_created_socket = 0
        self.lock = Lock()
        self.context = context
        self.name = name
        self.timezone = None  # timezone will be fetched from the kraken
        self.publication_date = -1
        self.is_up = True
        self.breaker = pybreaker.CircuitBreaker(
            fail_max=app.config['CIRCUIT_BREAKER_MAX_INSTANCE_FAIL'],
            reset_timeout=app.config['CIRCUIT_BREAKER_INSTANCE_TIMEOUT_S'])
        self.georef = georef.Kraken(self)
        self.planner = planner.Kraken(self)

        self.schedule = schedule.MixedSchedule(self)
        self.realtime_proxy_manager = realtime_schedule.RealtimeProxyManager(
            realtime_proxies_configuration)
        from jormungandr.autocomplete.kraken import Kraken
        self.autocomplete = Kraken()
Example #2
0
compat.patch_reqparse()

rest_api = Api(app, catch_all_404s=True, serve_challenge_on_401=True)

from navitiacommon.models import db
db.init_app(app)
cache = Cache(app, config=app.config['CACHE_CONFIGURATION'])

if app.config['AUTOCOMPLETE_SYSTEMS'] is not None:
    global_autocomplete = {
        k: utils.create_object(v)
        for k, v in app.config['AUTOCOMPLETE_SYSTEMS'].items()
    }
else:
    from jormungandr.autocomplete.kraken import Kraken
    global_autocomplete = {'kraken': Kraken()}

from jormungandr.instance_manager import InstanceManager

i_manager = InstanceManager(
    instances_dir=app.config.get('INSTANCES_DIR', None),
    start_ping=app.config.get('START_MONITORING_THREAD', True))
i_manager.initialisation()

from jormungandr.stat_manager import StatManager
stat_manager = StatManager()

from jormungandr.parking_space_availability.bss.bss_provider_manager import BssProviderManager
bss_provider_manager = BssProviderManager(app.config['BSS_PROVIDER'])
from jormungandr.parking_space_availability.car.car_park_provider_manager import CarParkingProviderManager
car_park_provider_manager = CarParkingProviderManager(