class documentation

class PluginManagerClass(ConnectorMixin, SignalEmitter, abc.Mapping): (source)

View In Hierarchy

Manager that maintains a set of active plugins

This class is the interface towards the rest of the application to load/unload plugins. It behaves as a dictionary with plugin object names as keys and plugin objects as value

Class Method get_plugin_class Get the plugin class for a given name
Class Method list_installed_plugins Lists plugin names for all installed plugins @returns: a set of plugin names
Method __call__ Undocumented
Method __getitem__ Undocumented
Method __init__ No summary
Method __iter__ Undocumented
Method __len__ Undocumented
Method load_plugin Load a single plugin by name
Method load_plugins_from_preferences Calls load_plugin() for each plugin in names but does not raise an exception when loading fails.
Method register_new_extendable No summary
Method remove_plugin Remove a plugin and it's extensions Fails silently if the plugin is not loaded. @param name: the plugin module name
Class Variable __signals__ Undocumented
Instance Variable failed Undocumented
Instance Variable insertedobjects Undocumented
Method _extend Undocumented
Method _extendables Undocumented
Method _reset Undocumented
Instance Variable _extendable_weakrefs Undocumented
Instance Variable _plugins Undocumented
Instance Variable _preferences Undocumented

Inherited from ConnectorMixin:

Method connectto Connect to signals of another object E.g.:
Method connectto_all Convenience method to combine multiple calls to connectto().
Method disconnect_all Disconnect all signals that have been connected with connectto and friends. Typically called when you want to destroy this object.
Method disconnect_from Disc all signals that have been connected with connectto and friends to a specific object.
Method _disconnect_from Undocumented
Instance Variable _connected_signals Undocumented

Inherited from SignalEmitter:

Method __new__ Undocumented
Method block_signals Returns a context manager for blocking one or more signals
Method connect Register a handler for a specific object.
Method connect_after Like connect() but handler will be called after default handler
Method disconnect Undocumented
Method emit Undocumented
Method emit_return_first Emits a signal and stops emission on the first handler that returns a not-None value.
Method emit_return_iter Returns an generator that calls one handler on each iteration and yields the return values. This allows aggregating return values.
Method _connect Undocumented
Method _setup_signal Undocumented
Method _teardown_signal Undocumented
@classmethod
def get_plugin_class(klass, name): (source)
Get the plugin class for a given name
Parameters
klassUndocumented
namethe plugin module name
Returns
the plugin class object
@classmethod
def list_installed_plugins(klass): (source)
Lists plugin names for all installed plugins
Returns
a set of plugin names
def __call__(self): (source)

Undocumented

def __getitem__(self, name): (source)

Undocumented

def __init__(self): (source)
Constructor Constructor will directly load a list of default plugins based on the preferences in the config. Failures while loading these plugins will be logged but not raise errors.
Parameters
configa ConfigManager object that is passed along to the plugins and is used to load plugin preferences. Defaults to a VirtualConfigManager for testing.
def __iter__(self): (source)

Undocumented

def __len__(self): (source)

Undocumented

def load_plugin(self, name): (source)

Load a single plugin by name

When the plugin was loaded already the existing object will be returned. Thus for each plugin only one instance can be active.

Parameters
namethe plugin module name
Returns
the plugin object
Raises
Exceptionwhen loading the plugin failed
def load_plugins_from_preferences(self, names): (source)
Calls load_plugin() for each plugin in names but does not raise an exception when loading fails.
def register_new_extendable(self, obj): (source)
Register an extendable object This is called automatically by the extendable() class decorator unless the option c{register_after_init} was set to False. Relies on obj already being setup correctly by the extendable decorator.
def remove_plugin(self, name): (source)
Remove a plugin and it's extensions Fails silently if the plugin is not loaded.
Parameters
namethe plugin module name
__signals__ = (source)

Undocumented

failed: set = (source)

Undocumented

insertedobjects = (source)

Undocumented

def _extend(self, plugin, obj): (source)

Undocumented

def _extendables(self): (source)

Undocumented

def _reset(self): (source)

Undocumented

_extendable_weakrefs = (source)

Undocumented

_plugins: dict = (source)

Undocumented

_preferences = (source)

Undocumented