2023-01-17 19:00:22 -05:00
|
|
|
"""
|
|
|
|
Config
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2023 Project Peter Yefi peteryefi@gmail.com
|
|
|
|
"""
|
2023-02-24 16:57:51 -05:00
|
|
|
import os
|
2023-03-10 10:18:27 -05:00
|
|
|
import platform
|
|
|
|
from pathlib import Path
|
2023-02-21 10:47:17 -05:00
|
|
|
|
2023-01-30 19:45:02 -05:00
|
|
|
from hub.exports.db_factory import DBFactory as CityExportFactory
|
|
|
|
from hub.imports.db_factory import DBFactory
|
2023-01-17 19:00:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
|
|
|
|
def __init__(self):
|
2023-04-06 12:25:41 -04:00
|
|
|
dotenv_path = "{}".format(os.path.expanduser('~'))
|
2023-02-24 16:57:51 -05:00
|
|
|
if platform.system() == 'Linux':
|
2023-04-06 12:25:41 -04:00
|
|
|
dotenv_path = f'{dotenv_path}/.local/etc/hub_api/.env'
|
2023-02-21 10:47:17 -05:00
|
|
|
environment = 'TEST'
|
2023-04-03 14:51:21 -04:00
|
|
|
database_name = 'montreal_retrofit_test'
|
2023-02-20 22:10:09 -05:00
|
|
|
|
2023-02-21 10:47:17 -05:00
|
|
|
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)
|