From 3f649fefc874e5a556182fe6286bff6a3f75772e Mon Sep 17 00:00:00 2001 From: joeflack4 Date: Tue, 20 Jun 2023 19:53:20 -0400 Subject: [PATCH] testing --- omim2obo/config.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/omim2obo/config.py b/omim2obo/config.py index 8387e62..f1f9938 100644 --- a/omim2obo/config.py +++ b/omim2obo/config.py @@ -1,9 +1,11 @@ +import os from pathlib import Path import yaml from dotenv import dotenv_values ROOT_DIR = Path(__file__).resolve().parent.parent DATA_DIR = ROOT_DIR / 'data' +ENV_PATH = ROOT_DIR / '.env' with open(DATA_DIR / 'dipper/GLOBAL_TERMS.yaml') as file: GLOBAL_TERMS = yaml.safe_load(file) @@ -11,4 +13,25 @@ with open(DATA_DIR / 'dipper/curie_map.yaml') as file: CURIE_MAP = yaml.safe_load(file) -config = dotenv_values(ROOT_DIR / '.env') +config = dotenv_values(ENV_PATH) +print('CONFIG') +print(config) +print('env path') +print(ENV_PATH) +print('ls root') +print(os.listdir(ROOT_DIR)) + +print('env contents') +with open(ENV_PATH, 'r') as file: + lines = file.readlines() + for line in lines: + var, val = line.split('=') + config[var] = val + print(lines) +print('CONFIG') +print(config) + +# TODO: get this to work: +print(str(config['API_KEY'])) +raise Exception('stop here') +