errbot.plugin_manager module¶
Logic related to plugin loading and lifecycle
-
class
errbot.plugin_manager.
BotPluginManager
(storage_plugin: errbot.storage.base.StoragePluginBase, extra_plugin_dir: Optional[str], autoinstall_deps: bool, core_plugins: Tuple[str, ...], plugin_instance_callback: Callable[[str, Type[errbot.botplugin.BotPlugin]], errbot.botplugin.BotPlugin], plugins_callback_order: Tuple[Optional[str], ...])[source]¶ Bases:
errbot.storage.StoreMixin
-
__init__
(storage_plugin: errbot.storage.base.StoragePluginBase, extra_plugin_dir: Optional[str], autoinstall_deps: bool, core_plugins: Tuple[str, ...], plugin_instance_callback: Callable[[str, Type[errbot.botplugin.BotPlugin]], errbot.botplugin.BotPlugin], plugins_callback_order: Tuple[Optional[str], ...])[source]¶ Creates a Plugin manager :type autoinstall_deps:
bool
:type storage_plugin:StoragePluginBase
:param storage_plugin: the plugin used to store to config for this manager :param extra_plugin_dir: an extra directory to search for plugins :param autoinstall_deps: if True, will install also the plugin deps from requirements.txt :param core_plugins: the list of core plugin that will be started :param plugin_instance_callback: the callback to instantiate a plugin (to inject the dependency on the bot) :param plugins_callback_order: the order on which the plugins will be callbacked
-
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.
-
get_all_active_plugins
() → List[errbot.botplugin.BotPlugin][source]¶ This returns the list of plugins in the callback ordered defined from the config.
-
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: errbot.botplugin.BotPlugin)[source]¶ Deactivate and remove a plugin completely. :type plugin:
BotPlugin
:param plugin: the plugin to remove :return:
-
-
errbot.plugin_manager.
check_errbot_version
(plugin_info: errbot.plugin_info.PluginInfo)[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
(plugin_info: errbot.plugin_info.PluginInfo) → bool[source]¶ Checks if we have the correct version to run this plugin. Returns true if the plugin is loadable