envisage.package_plugin_manager module

A plugin manager that finds plugins in packages on the ‘plugin_path’.

class envisage.package_plugin_manager.PackagePluginManager(**traits)[source]

Bases: PluginManager

A plugin manager that finds plugins in packages on the ‘plugin_path’.

All items in ‘plugin_path’ are directory names and they are all added to ‘sys.path’ (if not already present). Each directory is then searched for plugins as follows:-

a) If the package contains a ‘plugins.py’ module, then we import it and look for a callable ‘get_plugins’ that takes no arguments and returns a list of plugins (i.e. instances that implement ‘IPlugin’!).

b) If the package contains any modules named in the form ‘xxx_plugin.py’ then the module is imported and if it contains a callable ‘XXXPlugin’ it is called with no arguments and it must return a single plugin.

PLUGIN_MANIFEST = 'plugins.py'