Manage several plugins by ordering them in several categories.
The mechanism for searching and loading the plugins is already
implemented in this class so that it can be used directly (hence
it can be considered as a bit more than a mere interface)
The file describing a plugin should be written in the sytax
compatible with Python's ConfigParser module as in the following
example:
|
__init__(self,
categories_filter={ ' Default ' : <class 'yapsy.IPlugin.IPlugin'>} ,
directories_list=None,
plugin_info_ext=' yapsy-plugin ' )
Initialize the mapping of the categories and set the list of
directories where plugins may be. |
source code
|
|
|
|
|
|
|
|
|
setPluginPlaces(self,
directories_list)
Set the list of directories where to look for plugin places. |
source code
|
|
|
|
|
getCategories(self)
Return the list of all categories. |
source code
|
|
|
getPluginsOfCategory(self,
category_name)
Return the list of all plugins belonging to a category. |
source code
|
|
|
_gatherCorePluginInfo(self,
directory,
filename)
Gather the core information (name, and module to be loaded)
about a plugin described by it's info file (found at
'directory/filename'). |
source code
|
|
|
gatherBasicPluginInfo(self,
directory,
filename)
Gather some basic documentation about the plugin described by
it's info file (found at 'directory/filename'). |
source code
|
|
|
|
|
loadPlugins(self,
callback=None)
Load the candidate plugins that have been identified through a
previous call to locatePlugins. |
source code
|
|
|
|
|
getPluginByName(self,
name,
category=' Default ' )
Get the plugin correspoding to a given category and name |
source code
|
|
|
activatePluginByName(self,
name,
category=' Default ' )
Activate a plugin corresponding to a given category + name. |
source code
|
|
|
deactivatePluginByName(self,
name,
category=' Default ' )
Desactivate a plugin corresponding to a given category + name. |
source code
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|