Defines plugin managers that can handle configuration files similar to the ini files manipulated by Python’s ConfigParser module.
A plugin manager that also manages a configuration file.
The configuration file will be accessed through a ConfigParser derivated object. The file can be used for other purpose by the application using this plugin manager as it will only add a new specific section [Plugin Management] for itself and also new sections for some plugins that will start with [Plugin:...] (only the plugins that explicitly requires to save configuration options will have this kind of section).
when giving/building the list of plugins to activate by default, there must not be any space in the list (neither in the names nor in between)
The config_change_trigger argument can be used to set a specific method to call when the configuration is altered. This will let the client application manage the way they want the configuration to be updated (e.g. write on file at each change or at precise time intervalls or whatever....)
when no config_change_trigger is given and if the provided configparser_instance doesn’t handle it implicitely, recording the changes persistently (ie writing on the config file) won’t happen.
Activate a plugin, , and remember it (in the config file).
If you want the plugin to benefit from the configuration utility defined by this manager, it is crucial to use this method to activate a plugin and not call the plugin object’s activate method. In fact, this method will also “decorate” the plugin object so that it can use this class’s methods to register its own options.
By default, the plugin’s activation is registered in the config file but if you d’ont want this set the ‘save_state’ argument to False.
Deactivate a plugin, and remember it (in the config file).
By default, the plugin’s deactivation is registered in the config file but if you d’ont want this set the save_state argument to False.
To be called from a plugin object, return True if the option has already been registered.
Walk through the plugins’ places and look for plugins. Then for each plugin candidate look for its category, load it and stores it in the appropriate slot of the category_mapping.
To be called from a plugin object, read a given option in the name of a given plugin.
To be called from a plugin object, register a given option in the name of a given plugin.
Set the ConfigParser instance.