envisage.plugin_manager module

A simple plugin manager implementation.

class envisage.plugin_manager.PluginManager(plugins=None, **traits)[source]

Bases: HasTraits

A simple plugin manager implementation.

This implementation manages an explicit collection of plugin instances, e.g:

plugin_manager = PluginManager(plugins=[MyPlugin(), YourPlugin()])

Plugins can be added and removed after construction time via the methods ‘add_plugin’ and ‘remove_plugin’.

add_plugin(plugin)[source]

Add a plugin to the manager.

application = Instance(IApplication)

The application that the plugin manager is part of.

exclude = List(Str)

An optional list of the Ids of the plugins that are to be excluded by the manager.

Each item in the list is actually an ‘fnmatch’ expression.

get_plugin(plugin_id)[source]

Return the plugin with the specified Id.

include = List(Str)

An optional list of the Ids of the plugins that are to be included by the manager (i.e. only plugins with Ids in this list will be added to the manager).

Each item in the list is actually an ‘fnmatch’ expression.

plugin_added = Event(PluginEvent)

Fired when a plugin has been added to the manager.

plugin_removed = Event(PluginEvent)

Fired when a plugin has been removed from the manager.

remove_plugin(plugin)[source]

Remove a plugin from the manager.

start()[source]

Start the plugin manager.

start_plugin(plugin=None, plugin_id=None)[source]

Start the specified plugin.

stop()[source]

Stop the plugin manager.

stop_plugin(plugin=None, plugin_id=None)[source]

Stop the specified plugin.