2021-10-25 13:33:08 -04:00
|
|
|
"""
|
|
|
|
CustomizedImportsFactory is used to import any information using user customized formats
|
|
|
|
This factory can only be called after calling the construction factory.
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2022-04-08 09:35:33 -04:00
|
|
|
Copyright © 2022 Concordia CERC group
|
|
|
|
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
2021-10-25 13:33:08 -04:00
|
|
|
"""
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
class CustomizedImportsFactory:
|
|
|
|
"""
|
|
|
|
CustomizedImportsFactory class
|
|
|
|
"""
|
2021-10-25 18:05:51 -04:00
|
|
|
def __init__(self, importer_class, city, base_path=None):
|
2021-10-25 13:33:08 -04:00
|
|
|
if base_path is None:
|
|
|
|
base_path = Path(Path(__file__).parent.parent / 'data/customized_imports')
|
|
|
|
self._importer_class = importer_class
|
2021-10-25 18:05:51 -04:00
|
|
|
self._city = city
|
2021-10-25 13:33:08 -04:00
|
|
|
self._base_path = base_path
|
|
|
|
|
|
|
|
def enrich(self):
|
|
|
|
"""
|
2021-10-25 18:05:51 -04:00
|
|
|
Returns the class that will enrich the city given
|
|
|
|
:return: Class
|
2021-10-25 13:33:08 -04:00
|
|
|
"""
|
2021-10-25 18:05:51 -04:00
|
|
|
importer = self._importer_class(self._city, self._base_path)
|
|
|
|
return importer.enrich_buildings()
|