Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
joeflack4 committed Jun 20, 2023
1 parent 9461feb commit 3f649fe
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion omim2obo/config.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
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)

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')

0 comments on commit 3f649fe

Please sign in to comment.