Package yapsy :: Module VersionedPluginManager :: Class VersionedPluginManager
[hide private]

Class VersionedPluginManager

source code

                          object --+    
                                   |    
PluginManager.PluginManagerDecorator --+
                                       |
                                      VersionedPluginManager

Manage several plugins by ordering them in several categories with versioning capabilities.

Instance Methods [hide private]
 
__init__(self, decorated_manager=None, categories_filter={'Default': <class 'yapsy.IPlugin.IPlugin'>}, directories_list=None, plugin_info_ext='yapsy-plugin')
Create the plugin manager and record the ConfigParser instance that will be used afterwards.
source code
 
_prepareVersionMapping(self)
Create a mapping that will make it possible to easily provide the latest version of each plugin.
source code
 
setCategoriesFilter(self, categories_filter)
Set the categories of plugins to be looked for as well as the way to recognise them.
source code
 
getLatestPluginsOfCategory(self, category_name)
Return the list of all plugins belonging to a category.
source code
 
loadPlugins(self, callback=None)
Load the candidate plugins that have been identified through a previous call to locatePlugins.
source code

Inherited from PluginManager.PluginManagerDecorator: __getattr__, collectPlugins

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, decorated_manager=None, categories_filter={'Default': <class 'yapsy.IPlugin.IPlugin'>}, directories_list=None, plugin_info_ext='yapsy-plugin')
(Constructor)

source code 

Create the plugin manager and record the ConfigParser instance that will be used afterwards.

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....)

Overrides: PluginManager.PluginManagerDecorator.__init__

setCategoriesFilter(self, categories_filter)

source code 

Set the categories of plugins to be looked for as well as the way to recognise them.

The categories_filter first defines the various categories in which the plugins will be stored via its keys and it also defines the interface tha has to be inherited by the actual plugin class belonging to each category.

A call to this class will also reset the mapping of the latest version for each plugin.

loadPlugins(self, callback=None)

source code 

Load the candidate plugins that have been identified through a previous call to locatePlugins.

In addition to the baseclass functionality, this subclass also needs to find the latest version of each plugin.