You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is for those who have no experience authoring YAML, is to create a Python dictionary of the configuration settings for their application. The Python dictionary method is useful because it is what the YAML is going to map to, and what the application will be unit tested against. Especially for those who already have a working application.
Then provide a way for clients to call Confuse to persist the Python config dict in memory to disk, in YAML format. Then the next time the program runs, there is a default YAML config available to be loaded. It should virtually guarantee that there are no syntax errors in the YAML. It takes a load off the developper trying to debug YAML.
It would also be nice to show an example on how to do this in the documentation . I am sure it would drive more adoption in the module as I wasn't able to find many examples on the Internet. I ended having to clone your example project to debug it to better understand how it works.
example.py should create a new_template for the case where there is no existing configuration file, in order to create one the first time.
eg.
and then change from LazyConfig to base Configuration and set read=False.
config = confuse.Configuration('PaulConfuseExample', __name__, read=False)
The text was updated successfully, but these errors were encountered: