groundwork
groundwork copied to clipboard
Loading of configuration.py
The file configuration.py should be loaded by groundwork automatically during application startup.
Therefore there must be some mechanism to get the location of configuration.py to the gw app:
- Inside code (e.g. my_app = App(config="./conf.py"))
- Parameter on cli (e.g. -c /home/me/my_app/configuration.py)
- Environment-Variable (e.g. GROUNDWORK_CONFIG)
- Default value (e.g. %USER_HOME%//.config/gw/configuration.py)
Here's a proposal: http://stackoverflow.com/questions/7567642/where-to-put-a-configuration-file-in-python
For -c option, a plugin could register this function via CommandPattern.
But this plugin must be loaded before any other user defined plugin, so some kind of "internal_plugins = []" should be loaded... (Other names e.g. root_plugins)