~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/registry.py

  • Committer: Martin Pool
  • Date: 2008-12-09 01:49:56 UTC
  • mto: This revision was merged to the branch mainline in revision 3883.
  • Revision ID: mbp@sourcefrog.net-20081209014956-mbak0aw0zrprcido
Add Registry.items()

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
216
216
        for key, getter in self._dict.iteritems():
217
217
            yield key, getter.get_obj()
218
218
 
 
219
    def items(self):
 
220
        return sorted(self.iteritems())
 
221
 
219
222
    def _set_default_key(self, key):
220
223
        if not self._dict.has_key(key):
221
224
            raise KeyError('No object registered under key %s.' % key)