~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/registry.py

  • Committer: Aaron Bentley
  • Date: 2008-03-06 14:12:45 UTC
  • mto: (3251.4.4 lp-service)
  • mto: This revision was merged to the branch mainline in revision 3258.
  • Revision ID: aaron@aaronbentley.com-20080306141245-ukzpgujvk3zuajai
Add support for directory services

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
        """
168
168
        return self._dict[self._get_key_or_default(key)].get_obj()
169
169
 
 
170
    def get_prefix(self, fullname):
 
171
        for key, value in self.iteritems():
 
172
            if fullname.startswith(key):
 
173
                return value, fullname[len(key):]
 
174
 
170
175
    def _get_key_or_default(self, key=None):
171
176
        """Return either 'key' or the default key if key is None"""
172
177
        if key is not None: