/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/registry.py

  • Committer: Jelmer Vernooij
  • Date: 2020-04-05 19:11:34 UTC
  • mto: (7490.7.16 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200405191134-0aebh8ikiwygxma5
Populate the .gitignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Classes to provide name-to-object registry-like support."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
from .pyutils import get_named_object
20
22
 
 
23
from .sixish import viewitems
 
24
 
21
25
 
22
26
class _ObjectGetter(object):
23
27
    """Maintain a reference to an object, and return the object on request.
106
110
 
107
111
    def aliases(self):
108
112
        """Return a set of the format names which are aliases."""
109
 
        return dict(self._aliases.items())
 
113
        return dict(viewitems(self._aliases))
110
114
 
111
115
    def alias_map(self):
112
116
        ret = {}
113
 
        for alias, target in self._aliases.items():
 
117
        for alias, target in viewitems(self._aliases):
114
118
            ret.setdefault(target, []).append(alias)
115
119
        return ret
116
120