/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to brzlib/plugin.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 14:47:52 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521144752-8o6jt0a6xat9g7lm
More renames; commands in output, environment variables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""bzr python plugin support.
18
18
 
19
19
When load_plugins() is invoked, any python module in any directory in
20
 
$BZR_PLUGIN_PATH will be imported.  The module will be imported as
 
20
$BRZ_PLUGIN_PATH will be imported.  The module will be imported as
21
21
'brzlib.plugins.$BASENAME(PLUGIN)'.  In the plugin's main body, it should
22
22
update any brzlib registries it wants to extend.
23
23
 
24
24
See the plugin-api developer documentation for information about writing
25
25
plugins.
26
26
 
27
 
BZR_PLUGIN_PATH is also honoured for any plugins imported via
 
27
BRZ_PLUGIN_PATH is also honoured for any plugins imported via
28
28
'import brzlib.plugins.PLUGINNAME', as long as set_plugins_path has been
29
29
called.
30
30
"""
158
158
    _mod_plugins.__path__ = path
159
159
    PluginImporter.reset()
160
160
    # Set up a blacklist for disabled plugins
161
 
    disabled_plugins = os.environ.get('BZR_DISABLE_PLUGINS', None)
 
161
    disabled_plugins = os.environ.get('BRZ_DISABLE_PLUGINS', None)
162
162
    if disabled_plugins is not None:
163
163
        for name in disabled_plugins.split(os.pathsep):
164
164
            PluginImporter.blacklist.add('brzlib.plugins.' + name)
165
165
    # Set up a the specific paths for plugins
166
166
    for plugin_name, plugin_path in _get_specific_plugin_paths(os.environ.get(
167
 
            'BZR_PLUGINS_AT', None)):
 
167
            'BRZ_PLUGINS_AT', None)):
168
168
            PluginImporter.specific_paths[
169
169
                'brzlib.plugins.%s' % plugin_name] = plugin_path
170
170
    return path
234
234
    #   so that a set of plugins is disabled as once. This can be done via
235
235
    #   -site, -core, -user.
236
236
 
237
 
    env_paths = os.environ.get('BZR_PLUGIN_PATH', '+user').split(os.pathsep)
 
237
    env_paths = os.environ.get('BRZ_PLUGIN_PATH', '+user').split(os.pathsep)
238
238
    defaults = ['+core', '+site']
239
239
 
240
240
    # The predefined references
273
273
def load_plugins(path=None):
274
274
    """Load brzlib plugins.
275
275
 
276
 
    The environment variable BZR_PLUGIN_PATH is considered a delimited
 
276
    The environment variable BRZ_PLUGIN_PATH is considered a delimited
277
277
    set of paths to look through. Each entry is searched for `*.py`
278
278
    files (and whatever other extensions are used in the platform,
279
279
    such as `*.pyd`).