Module b.plugin

Part of bzrlib

bzr python plugin support.

When load_plugins() is invoked, any python module in any directory in $BZR_PLUGIN_PATH will be imported. The module will be imported as 'bzrlib.plugins.$BASENAME(PLUGIN)'. In the plugin's main body, it should update any bzrlib registries it wants to extend.

See the plugin-api developer documentation for information about writing plugins.

BZR_PLUGIN_PATH is also honoured for any plugins imported via 'import bzrlib.plugins.PLUGINNAME', as long as set_plugins_path has been called.

Line # Kind Name Docs
62 Function get_default_plugin_path Get the DEFAULT_PLUGIN_PATH
70 Function disable_plugins Disable loading plugins.
82 Function set_plugins_path Set the path for plugins to be loaded from.
95 Function get_standard_plugins_path Determine a plugin path suitable for general use.
135 Function load_plugins Load bzrlib plugins.
160 Function load_from_path Load bzrlib plugins found in each dir in dirs.
191 Function load_from_dir Load the plugins in directory d.
258 Function load_from_zip Load all the plugins in a zip.
338 Function plugins Return a dictionary of the plugins.
350 Class PluginsHelpIndex A help index that returns help topics for plugins.
378 Class ModuleHelpTopic A help topic which returns the docstring for a module.
418 Class PlugIn The bzrlib representation of a plugin.
78 Function _strip_trailing_sep Undocumented
def get_default_plugin_path():
Get the DEFAULT_PLUGIN_PATH
def disable_plugins():
Disable loading plugins.

Future calls to load_plugins() will be ignored.

def _strip_trailing_sep(path):
Undocumented
def set_plugins_path(path=None):
Set the path for plugins to be loaded from.
ParameterspathThe list of paths to search for plugins. By default, path will be determined using get_standard_plugins_path. if path is [], no plugins can be loaded.
def get_standard_plugins_path():
Determine a plugin path suitable for general use.
def load_plugins(path=None):
Load bzrlib plugins.

The environment variable BZR_PLUGIN_PATH is considered a delimited
set of paths to look through. Each entry is searched for *.py
files (and whatever other extensions are used in the platform,
such as *.pyd).

load_from_dirs() provides the underlying mechanism and is called with
the default directory list to provide the normal behaviour.

:param path: The list of paths to search for plugins.  By default,
    path will be determined using get_standard_plugins_path.
    if path is [], no plugins can be loaded.
def load_from_path(dirs):
Load bzrlib plugins found in each dir in dirs.

Loading a plugin means importing it into the python interpreter. The plugin is expected to make calls to register commands when it's loaded (or perhaps access other hooks in future.)

Plugins are loaded into bzrlib.plugins.NAME, and can be found there for future reference.

The python module path for bzrlib.plugins will be modified to be 'dirs'.

def load_from_dir(d):
Load the plugins in directory d.

d must be in the plugins module path already.

@deprecated_function(one_three)
def load_from_zip(zip_name):
Load all the plugins in a zip.
def plugins():
Return a dictionary of the plugins.

Each item in the dictionary is a PlugIn object.

API Documentation for BzrLib, generated by pydoctor at 2008-12-03 00:00:12.