/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: 2018-11-17 00:47:52 UTC
  • mfrom: (7182 work)
  • mto: This revision was merged to the branch mainline in revision 7305.
  • Revision ID: jelmer@jelmer.uk-20181117004752-6ywampe5pfywlby4
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
from .lazy_import import lazy_import
47
47
lazy_import(globals(), """
48
48
import imp
49
 
import importlib
50
49
from importlib import util as importlib_util
51
50
 
52
51
from breezy import (
422
421
            if sanitised_name.startswith('brz_'):
423
422
                sanitised_name = sanitised_name[len('brz_'):]
424
423
            trace.warning("Unable to load %r in %r as a plugin because the "
425
 
                    "file path isn't a valid module name; try renaming "
426
 
                    "it to %r." % (name, dir, sanitised_name))
 
424
                          "file path isn't a valid module name; try renaming "
 
425
                          "it to %r." % (name, dir, sanitised_name))
427
426
        else:
428
427
            return record_plugin_warning(
429
428
                'Unable to load plugin %r from %r: %s' % (name, dir, e))
438
437
    for fullname in sys.modules:
439
438
        if fullname.startswith(_MODULE_PREFIX):
440
439
            name = fullname[len(_MODULE_PREFIX):]
441
 
            if not "." in name and sys.modules[fullname] is not None:
 
440
            if "." not in name and sys.modules[fullname] is not None:
442
441
                result[name] = PlugIn(name, sys.modules[fullname])
443
442
    return result
444
443
 
465
464
    items = []
466
465
    for name, a_plugin in sorted(getattr(state, 'plugins', {}).items()):
467
466
        items.append("%s[%s]" %
468
 
            (name, a_plugin.__version__))
 
467
                     (name, a_plugin.__version__))
469
468
    return ', '.join(items)
470
469
 
471
470