Open astrofrog opened 6 years ago
Sounds like a good plan!
I think we could probably make this a little simpler by restricting the format of the config a little. I.e. each plugin gets it's own key in the top level config dict, with a dict underneath. I also think we should tie this to the app in the minimalist way possible. I.e.
app.config_manager = ConfigManager()
then things register their configs with the manager, and we just use the app as a way to get the reference to the manager.
I wonder if there is a toml schema thing somewhere? If not we could use https://github.com/alecthomas/voluptuous as a way of doing general dict schemas.
We now have a Config
object so it should be possible to add validation.
I think each blueprint and plugin should have a way of formally registering configuration items with the app, for instance doing something like:
when the module is loaded. This would allow:
@Cadair - what do you think?