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]
attach_bot(bot)[source]
blacklist_plugin(name)[source]
deactivate_all_plugins()[source]
deactivate_plugin(name)[source]
deactivate_plugin_by_name(name)[source]
get_all_active_plugin_names()[source]
get_all_active_plugin_objects()[source]
get_all_active_plugin_objects_ordered()[source]
get_all_plugin_names()[source]
get_blacklisted_plugin()[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]
get_plugin_configuration(name)[source]
get_plugin_obj_by_name(name: str) → errbot.botplugin.BotPlugin[source]
instanciateElement(element) → errbot.botplugin.BotPlugin[source]

Overrides the instanciation of plugins to inject the bot reference.

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)[source]

Deactivate and remove a plugin completely. :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_dynamic_plugins()[source]

It returns a dictionary of path -> error strings.

update_plugin_places(path_list, extra_plugin_dir, autoinstall_deps=True)[source]

It returns a dictionary of path -> error strings.

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_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.

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

errbot.plugin_manager.global_restart()[source]
errbot.plugin_manager.install_packages(req_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_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'>) → None[source]