~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/registry.py

  • Committer: Vincent Ladeuil
  • Date: 2007-11-04 15:24:27 UTC
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071104152427-p9k7e4toywa87wfc
Review feedback.

* doc/en/user-guide/authentication_conf.txt: 
New file. Authentication configuration file documentation.

* doc/en/user-guide/configuration.txt: 
Slight modifications, add authentication.conf reference.

* doc/en/mini-tutorial/index.txt: 
Fix make docs warning.

* doc/developers/authentication-ring.txt: 
Small cleanups noticed during
doc/en/user-guide/authentication_conf.txt redaction.

* bzrlib/transport/http/_urllib.py:
(HttpTransport_urllib._perform): Use a dict() instead of {} syntax.

* bzrlib/tests/blackbox/test_whoami.py:
(TestWhoami.test_whoami_branch): Delete BZREMAIL related tests.

* bzrlib/config.py:
(Config.username): BZREMAIL deleted, has been obsolete for more
than a year.
(AuthenticationConfig.__init__): Review feedback, since keeping a
callback as an attribute is useless, call it now and keep the
filename itself as an attribute.
(AuthenticationConfig.get_credentials): Use a dict() instead of {}
syntax.

* NEWS: 
Updated as per Martin's suggestion.

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
 
        """Return an object whose key is a prefix of the supplied value.
172
 
 
173
 
        :fullname: The name to find a prefix for
174
 
        :return: a tuple of (object, remainder), where the remainder is the
175
 
            portion of the name that did not match the key.
176
 
        """
177
 
        for key, value in self.iteritems():
178
 
            if fullname.startswith(key):
179
 
                return value, fullname[len(key):]
180
 
 
181
170
    def _get_key_or_default(self, key=None):
182
171
        """Return either 'key' or the default key if key is None"""
183
172
        if key is not None: