api_v1.4/hub_api/config.py

27 lines
860 B
Python
Raw Permalink Normal View History

"""
Config
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Project Peter Yefi peteryefi@gmail.com
"""
import os
import platform
from pathlib import Path
2023-01-30 19:45:02 -05:00
from hub.exports.db_factory import DBFactory as CityExportFactory
from hub.imports.db_factory import DBFactory
class Config:
def __init__(self):
2023-04-06 12:25:41 -04:00
dotenv_path = "{}".format(os.path.expanduser('~'))
if platform.system() == 'Linux':
2023-04-06 12:25:41 -04:00
dotenv_path = f'{dotenv_path}/.local/etc/hub_api/.env'
environment = 'TEST'
2023-04-03 14:51:21 -04:00
database_name = 'montreal_retrofit_test'
self.export_db_factory = CityExportFactory(db_name=database_name, app_env=environment,
dotenv_path=dotenv_path)
self.import_db_factory = DBFactory(db_name=database_name, app_env=environment,
dotenv_path=dotenv_path)