errbot.plugin_manager module¶
Logic related to plugin loading and lifecycle
-
class
errbot.plugin_manager.
BotPluginManager
(storage_plugin, repo_manager, extra, autoinstall_deps, core_plugins, plugins_callback_order)[source]¶ Bases:
yapsy.PluginManager.PluginManager
,errbot.storage.StoreMixin
Customized yapsy PluginManager for ErrBot.
-
BL_PLUGINS
= 'bl_plugins'¶
-
CONFIGS
= 'configs'¶
-
__init__
(storage_plugin, repo_manager, extra, autoinstall_deps, core_plugins, plugins_callback_order)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
activate_non_started_plugins
()[source]¶ Activates all plugins that are not activated, respecting its dependencies.
Returns: Empty string if no problem occured or a string explaining what went wrong.
-
activate_plugin
(name)[source]¶ Activate the given plugin.
Parameters: name – the name of the plugin you want to activate. Throws PluginActivationException: if an error occured while activating the plugin.
-
activate_plugin_with_version_check
(plugin_info: <module 'yapsy.PluginInfo' from '/home/docs/checkouts/readthedocs.org/user_builds/errbot/envs/5.2.0/lib/python3.7/site-packages/yapsy/PluginInfo.py'>, dep_track=None) → errbot.botplugin.BotPlugin[source]¶
-
get_plugin_by_name
(name: str) → <module 'yapsy.PluginInfo' from '/home/docs/checkouts/readthedocs.org/user_builds/errbot/envs/5.2.0/lib/python3.7/site-packages/yapsy/PluginInfo.py'>[source]¶
-
instanciateElement
(element) → errbot.botplugin.BotPlugin[source]¶ Overrides the instanciation of plugins to inject the bot reference.
-
reload_plugin_by_name
(name)[source]¶ Completely reload the given plugin, including reloading of the module’s code :throws PluginActivationException: needs to be taken care of by the callers.
-
remove_plugin
(plugin)[source]¶ Deactivate and remove a plugin completely. :param plugin: the plugin to remove :return:
-
-
errbot.plugin_manager.
check_dependencies
(req_path: str) → Tuple[str, Sequence[str]][source]¶ This methods returns a pair of (message, packages missing). Or None, [] if everything is OK.
-
errbot.plugin_manager.
check_enabled_core_plugin
(name: str, config: configparser.ConfigParser, core_plugin_list) → bool[source]¶ Checks if the given plugin is core and if it is, if it is part of the enabled core_plugins_list.
Return type: bool
Parameters: - name (
str
) – The plugin name - config (
ConfigParser
) – Its config - core_plugin_list – the list from CORE_PLUGINS in the config.
Returns: True if it is OK to load this plugin.
- name (
-
errbot.plugin_manager.
check_errbot_plug_section
(name: str, config: configparser.ConfigParser) → bool[source]¶ Checks if we have the correct Errbot version. Returns true if the plugin is loadable
-
errbot.plugin_manager.
check_errbot_version
(name: str, min_version: str, max_version: str)[source]¶ Checks if a plugin version between min_version and max_version is ok for this errbot. Raises IncompatiblePluginException if not.
-
errbot.plugin_manager.
check_python_plug_section
(name: str, config: configparser.ConfigParser) → bool[source]¶ Checks if we have the correct version to run this plugin. Returns true if the plugin is loadable