Conversation
|
@hl1 - Currently, the code does not use any of these variables. This is the first step, where you have created a script to capture the YAML information. Correct? Also, please be sure to update the requirements with YAML and specify the latest version number. |
| c.add('app_dir', c.get('base_dir') / 'app') | ||
| c.add('data_dir', c.get('app_dir') / 'data') | ||
| c.add('log_dir', c.get('app_dir') / 'log') | ||
| c.add('json_file_name',os.path.basename(max(glob.glob(str(c.get('data_dir')) + '/*.json'), key=os.path.getctime))) |
There was a problem hiding this comment.
I have a drugs-ndc.json in the data folder however the following error occurs:
File "app/utils/config.py", line 45, in yaml_construct
c.add('json_file_name',os.path.basename(max(glob.glob(str(c.get('data_dir')) + '/*.json'), key=os.path.getctime)))
ValueError: max() arg is an empty sequence```
There was a problem hiding this comment.
@hl1 - Currently, the code does not use any of these variables. This is the first step, where you have created a script to capture the YAML information. Correct?
Also, please be sure to update the requirements with YAML and specify the latest version number.
Correct. this is an independent system that could be added to master without impacting anything. integration is coming.
There was a problem hiding this comment.
I have a drugs-ndc.json in the data folder however the following error occurs:
File "app/utils/config.py", line 45, in yaml_construct c.add('json_file_name',os.path.basename(max(glob.glob(str(c.get('data_dir')) + '/*.json'), key=os.path.getctime))) ValueError: max() arg is an empty sequence```
hmmm... is the data folder in /app/data or /data?
yevgenybulochnik
left a comment
There was a problem hiding this comment.
Going to approve this for now and we will need to make changes.
config.yml has full control of all application variables.
specifying allows python.py to replace it with python code using the class method replace_dynamic()
I have also enabled a way to reference other configurations by putting them in between <>
[EDIT]
Everything that I said above is invalid. I have converted the code to use yaml tags
https://stackoverflow.com/questions/43058050/creating-custom-tag-in-pyyaml