/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 breezy/plugin.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-13 23:57:28 UTC
  • mfrom: (7490 work)
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200213235728-m6ds0mm3mbs4y182
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
plugins.
35
35
"""
36
36
 
 
37
from __future__ import absolute_import
 
38
 
37
39
import os
38
40
import re
39
41
import sys
76
78
    state.plugins = {}
77
79
 
78
80
 
79
 
def load_plugins(path=None, state=None, warn_load_problems=True):
 
81
def load_plugins(path=None, state=None):
80
82
    """Load breezy plugins.
81
83
 
82
84
    The environment variable BRZ_PLUGIN_PATH is considered a delimited
103
105
    if (None, 'entrypoints') in _env_plugin_path():
104
106
        _load_plugins_from_entrypoints(state)
105
107
    state.plugins = plugins()
106
 
    if warn_load_problems:
107
 
        for plugin, errors in state.plugin_warnings.items():
108
 
            for error in errors:
109
 
                trace.warning('%s', error)
110
108
 
111
109
 
112
110
def _load_plugins_from_entrypoints(state):
193
191
def _env_disable_plugins(key='BRZ_DISABLE_PLUGINS'):
194
192
    """Gives list of names for plugins to disable from environ key."""
195
193
    disabled_names = []
196
 
    env = os.environ.get(key)
 
194
    env = osutils.path_from_environ(key)
197
195
    if env:
198
196
        for name in env.split(os.pathsep):
199
197
            name = _expect_identifier(name, key, env)
205
203
def _env_plugins_at(key='BRZ_PLUGINS_AT'):
206
204
    """Gives list of names and paths of specific plugins from environ key."""
207
205
    plugin_details = []
208
 
    env = os.environ.get(key)
 
206
    env = osutils.path_from_environ(key)
209
207
    if env:
210
208
        for pair in env.split(os.pathsep):
211
209
            if '@' in pair:
226
224
    'path', or None and one of the values 'user', 'core', 'entrypoints', 'site'.
227
225
    """
228
226
    path_details = []
229
 
    env = os.environ.get(key)
 
227
    env = osutils.path_from_environ(key)
230
228
    defaults = {
231
229
        "user": not env,
232
230
        "core": True,