[entropy.core] add more doc to EntropyPluginFactory and ability to disable plugins
This commit is contained in:
@@ -85,6 +85,12 @@ class EntropyPluginFactory:
|
||||
above otherwise plugin won't be loaded and a warning will be
|
||||
printed.
|
||||
|
||||
Moreover, plugin classes must be "Python new-style classes", otherwise
|
||||
__subclasses__ method won't be available and class won't be considered
|
||||
at all (see: http://www.python.org/doc/newstyle).
|
||||
|
||||
If plugin class features a "PLUGIN_DISABLED" class attribute with
|
||||
a value of True, such plugin will be ignored.
|
||||
|
||||
@param base_plugin_class: Base EntropyPlugin-based class that valid
|
||||
plugin classes must inherit from.
|
||||
@@ -173,6 +179,11 @@ class EntropyPluginFactory:
|
||||
"PLUGIN_API_VERSION mismatch !!!\n")
|
||||
continue
|
||||
|
||||
if hasattr(obj, 'PLUGIN_DISABLED'):
|
||||
if obj.PLUGIN_DISABLED:
|
||||
# this plugin has been disabled
|
||||
continue
|
||||
|
||||
available[modname_clean] = obj
|
||||
|
||||
self.__cache = available.copy()
|
||||
|
||||
Reference in New Issue
Block a user