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