Plugin
¶
-
class
mnemosyne.libmnemosyne.plugin.
Plugin
(component_manager)¶ A Plugin is a group of components which can be activated and deactivated by the user when the program is running.
Plugins are used as a separate class, and not as mixins, in order to allow for the fact that a Plugin can group multiple components.
‘components’ is a list of component classes (not instances) that will be registered and/or instantiated when the Plugin becomes active.
‘gui_for_component’ is a dictionary with as key a component class to which a GUI component needs to be added. The value is a list of tuples [(“module_name”, “class_name”)]
Activating and deactivating certain components needs to give rise to certain side effects. It’s cumbersone to implement those in the ‘activate’ and ‘deactivate’ methods of the components, as these also are called when the program is still starting up and the context can be completely different. Therefore, they are handled here.
-
activate
()¶ Initialisation code called when the component is about to do actual work, and which can’t happen in the constructor, e.g. because components on which it relies have not yet been registered.
-
component_type
= 'plugin'¶
-
components
= []¶
-
current_API_level
= 3¶
-
deactivate
()¶
-
description
= ''¶
-
gui_for_component
= {}¶
-
name
= ''¶
-