From d8fea13dc5cf9bbcff80be7c9bb6834fda08cfdb Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 1 Dec 2019 12:06:46 +0100 Subject: cli --- cli/app/settings/app_cfg.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 cli/app/settings/app_cfg.py (limited to 'cli/app/settings/app_cfg.py') diff --git a/cli/app/settings/app_cfg.py b/cli/app/settings/app_cfg.py new file mode 100644 index 0000000..fe65458 --- /dev/null +++ b/cli/app/settings/app_cfg.py @@ -0,0 +1,37 @@ +import os +from os.path import join +import collections +import logging + +from dotenv import load_dotenv +import yaml + +from app.models import types +from pathlib import Path + +import codecs +codecs.register(lambda name: codecs.lookup('utf8') if name == 'utf8mb4' else None) + +# ----------------------------------------------------------------------------- +# Click config +# ----------------------------------------------------------------------------- + +CLICK_GROUPS = { + 'process': 'commands/process', +} + +# ----------------------------------------------------------------------------- +# File I/O +# ----------------------------------------------------------------------------- + +SELF_CWD = os.path.dirname(os.path.realpath(__file__)) # Script CWD +DIR_APP = str(Path(SELF_CWD).parent.parent.parent) + +FP_MODELZOO = join(DIR_APP, 'modelzoo/modelzoo.yaml') + +# ----------------------------------------------------------------------------- +# Model config +# ----------------------------------------------------------------------------- + +with open(FP_MODELZOO, 'r') as fp: + MODELZOO_CFG = yaml.load(fp, Loader=yaml.Loader) -- cgit v1.2.3-70-g09d2