2020-06-09 14:07:47 -04:00
|
|
|
"""
|
2020-12-15 15:15:40 -05:00
|
|
|
SchedulesFactory retrieve the specific schedules module for the given standard
|
2020-06-09 14:07:47 -04:00
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
|
|
"""
|
2020-05-18 13:25:08 -04:00
|
|
|
|
2020-12-15 15:15:40 -05:00
|
|
|
from pathlib import Path
|
2021-06-01 18:31:50 -04:00
|
|
|
from imports.schedules.comnet_schedules_parameters import ComnetSchedules
|
2021-08-25 07:23:02 -04:00
|
|
|
from imports.schedules.doe_idf import DoeIdf
|
2020-05-18 13:25:08 -04:00
|
|
|
|
2020-12-15 15:15:40 -05:00
|
|
|
|
|
|
|
class SchedulesFactory:
|
2020-06-15 11:38:18 -04:00
|
|
|
"""
|
2020-12-15 15:15:40 -05:00
|
|
|
SchedulesFactor class
|
2020-06-15 11:38:18 -04:00
|
|
|
"""
|
2021-05-26 18:17:23 -04:00
|
|
|
def __init__(self, handler, city, base_path=Path(Path(__file__).parent.parent / 'data/schedules')):
|
2020-12-15 15:15:40 -05:00
|
|
|
self._handler = '_' + handler.lower().replace(' ', '_')
|
|
|
|
self._city = city
|
|
|
|
self._base_path = base_path
|
2020-06-30 16:14:39 -04:00
|
|
|
|
2020-12-15 15:15:40 -05:00
|
|
|
def _comnet(self):
|
|
|
|
ComnetSchedules(self._city, self._base_path)
|
2020-06-30 16:14:39 -04:00
|
|
|
|
2021-08-25 07:23:02 -04:00
|
|
|
def _doe_idf(self):
|
|
|
|
print('Idf handler call')
|
|
|
|
DoeIdf(self._city, self._base_path)
|
|
|
|
|
2021-04-07 11:46:44 -04:00
|
|
|
def enrich(self):
|
2020-06-30 16:14:39 -04:00
|
|
|
"""
|
2020-12-15 15:15:40 -05:00
|
|
|
Enrich the city with the schedules information
|
|
|
|
:return: None
|
2020-06-30 16:14:39 -04:00
|
|
|
"""
|
2020-12-15 15:15:40 -05:00
|
|
|
getattr(self, self._handler, lambda: None)()
|