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_flow(name: str)[source]
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: str)[source]

Activate a plugin with its dependencies.

blacklist_plugin(name)[source]
deactivate_all_plugins()[source]
deactivate_flow(name: str)[source]
deactivate_plugin(name: str)[source]
get_all_active_plugin_names()[source]
get_all_active_plugins() → List[errbot.botplugin.BotPlugin][source]

This returns the list of plugins in the callback ordered defined from the config.

get_all_plugin_names()[source]
get_blacklisted_plugin()[source]
get_plugin_by_path(path)[source]
get_plugin_configuration(name)[source]
get_plugin_obj_by_name(name: str) → errbot.botplugin.BotPlugin[source]
is_plugin_blacklisted(name)[source]
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:

remove_plugins_from_path(root)[source]

Remove all the plugins that are in the filetree pointed by root.

set_plugin_configuration(name, obj)[source]
shutdown()[source]
unblacklist_plugin(name)[source]
update_plugin_places(path_list) → Dict[pathlib.Path, str][source]

This updates where this manager is trying to find plugins and try to load newly found ones. :param path_list: the path list where to search for plugins. :return: the feedback for any specific path in case of error.

exception errbot.plugin_manager.IncompatiblePluginException[source]

Bases: errbot.plugin_manager.PluginActivationException

exception errbot.plugin_manager.PluginActivationException[source]

Bases: Exception

exception errbot.plugin_manager.PluginConfigurationException[source]

Bases: errbot.plugin_manager.PluginActivationException

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

errbot.plugin_manager.install_packages(req_path: pathlib.Path)[source]

Installs all the packages from the given requirements.txt

Return an exc_info if it fails otherwise None.

errbot.plugin_manager.populate_doc(plugin_object: errbot.botplugin.BotPlugin, plugin_info: errbot.plugin_info.PluginInfo) → None[source]