Part of bzrlib
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.
Function | are_plugins_disabled | Undocumented |
Function | disable_plugins | Disable loading plugins. |
Function | describe_plugins | Generate text description of plugins. |
Function | set_plugins_path | Set the path for plugins to be loaded from. |
Function | get_core_plugin_path | Undocumented |
Function | get_site_plugin_path | Returns the path for the site installed plugins. |
Function | get_user_plugin_path | Undocumented |
Function | get_standard_plugins_path | Determine a plugin path suitable for general use. |
Function | load_plugins | Load bzrlib plugins. |
Function | load_from_path | Load bzrlib plugins found in each dir in dirs. |
Function | record_plugin_warning | Undocumented |
Function | load_from_dir | Load the plugins in directory d. |
Function | plugins | Return a dictionary of the plugins. |
Function | format_concise_plugin_list | Return a string holding a concise list of plugins and their version. |
Class | PluginsHelpIndex | A help index that returns help topics for plugins. |
Class | ModuleHelpTopic | A help topic which returns the docstring for a module. |
Class | PlugIn | The bzrlib representation of a plugin. |
Function | _strip_trailing_sep | Undocumented |
Function | _get_specific_plugin_paths | Returns the plugin paths from a string describing the associations. |
Function | _append_new_path | Append a new path if it set and not already known. |
Function | _find_plugin_module | Check if there is a valid python module that can be loaded as a plugin. |
Function | _load_plugin_module | Load plugin name from dir. |
Class | _PluginImporter | An importer tailored to bzr specific needs. |
Includes both those that have loaded, and those that failed to load.
Parameters | show_paths | If true, |
Returns | Iterator of text lines (including newlines.) |
For example, if paths is my_plugin@/test/my-test:her_plugin@/production/her, [('my_plugin', '/test/my-test'), ('her_plugin', '/production/her')] will be returned.
Note that ':' in the example above depends on the os.
Parameters | paths | A string describing the paths associated with the plugins. |
Returns | A list of (plugin name, path) tuples. |
Parameters | 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. |
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_path() provides the underlying mechanism and is called with the default directory list to provide the normal behaviour.
Parameters | 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. |
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'.
Parameters | dir | The directory where the search is performed. |
path | An existing file path, either a python file or a package directory. | |
Returns | (name, path, description) name is the module name, path is the file to load and description is the tuple returned by imp.get_suffixes(). |
Parameters | name | The plugin name in the bzrlib.plugins namespace. |
dir | The directory the plugin is loaded from for error messages. |