-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added the config system #26
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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