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-03-10 12:45:11 -05:00
|
|
|
dotenv_path = "{}/.env".format(os.path.expanduser('~'))
|
2023-02-24 16:57:51 -05:00
|
|
|
if platform.system() == 'Linux':
|
|
|
|
dotenv_path = Path('/usr/local/etc/hub/.env').resolve()
|
|
|
|
|
2023-02-21 10:47:17 -05:00
|
|
|
environment = 'TEST'
|
|
|
|
database_name = 'persistence_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)
|