groundwork icon indicating copy to clipboard operation
groundwork copied to clipboard

Loading of configuration.py

Open danwos opened this issue 8 years ago • 2 comments

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)

danwos avatar Dec 22 '16 08:12 danwos

Here's a proposal: http://stackoverflow.com/questions/7567642/where-to-put-a-configuration-file-in-python

ubmarco avatar Dec 22 '16 09:12 ubmarco

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)

danwos avatar Apr 19 '17 11:04 danwos