-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfiguration.py
More file actions
28 lines (23 loc) · 810 Bytes
/
Copy pathconfiguration.py
File metadata and controls
28 lines (23 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import sys
import logging
from typing import List
from config import ProdConfig, DevConfig, TestsConfig
from utils import general
USER_CONFIG_FILENAME = "user_config.json"
USER_CONFIG_PATH = os.path.join("user_config", USER_CONFIG_FILENAME)
CHAINS_EXCHANGES_MAP_PATH = os.path.join("utils", "chains_exchanges_map.json")
def get_user_conf():
return general.get_json("", USER_CONFIG_PATH)
def _prepare_configuraton():
env = os.getenv("TENV", None)
if env == "prod":
return ProdConfig()
elif env == "dev":
return DevConfig()
elif env == "tests":
return TestsConfig()
else:
logging.error("Parameter 'env' has not been passed (environemnt variable TENV is None). Application cannot start.")
sys.exit()
conf = _prepare_configuraton()