summer_course_2024/factories/occupancy_factory.py
2020-12-15 14:57:46 -05:00

30 lines
850 B
Python

"""
SchedulesFactory retrieve the specific schedules module for the given standard
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from pathlib import Path
from factories.occupancy_feeders.usage_schedules import ComnetSchedules
class SchedulesFactory:
"""
SchedulesFactor class
"""
def __init__(self, handler, city, base_path=Path(Path(__file__).parent.parent / 'data/occupancy')):
self._handler = '_' + handler.lower().replace(' ', '_')
self._city = city
self._base_path = base_path
self.factory()
def _comnet(self):
ComnetSchedules(self._city, self._base_path)
def factory(self):
"""
Enrich the city with the schedules information
:return: None
"""
getattr(self, self._handler, lambda: None)()