~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.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:
236
236
        v = os.environ.get('BZR_EMAIL')
237
237
        if v:
238
238
            return v.decode(bzrlib.user_encoding)
239
 
        v = os.environ.get('BZREMAIL')
240
 
        if v:
241
 
            # FIXME: Seems to have been deprecated since more than a year now,
242
 
            # time to delete ? -- vila 20071019
243
 
            trace.warning('BZREMAIL is deprecated in favor of BZR_EMAIL.'
244
 
                          ' Please update your configuration.')
245
 
            return v.decode(bzrlib.user_encoding)
246
239
 
247
240
        v = self._get_user_id()
248
241
        if v:
947
940
    """
948
941
 
949
942
    def __init__(self, _file=None):
950
 
        super(AuthenticationConfig, self).__init__()
951
943
        self._config = None # The ConfigObj
952
944
        if _file is None:
953
 
            self._get_filename = authentication_config_filename
954
 
            self._input = self._get_filename()
 
945
            self._filename = authentication_config_filename()
 
946
            self._input = self._filename = authentication_config_filename()
955
947
        else:
956
 
            self._get_filename = None
 
948
            # Tests can provide a string as _file
 
949
            self._filename = None
957
950
            self._input = _file
958
951
 
959
952
    def _get_config(self):
1049
1042
            if a_user is None:
1050
1043
                # Can't find a user
1051
1044
                continue
1052
 
            credentials = {'name': auth_def_name,
1053
 
                           'user': a_user, 'password': auth_def['password'],
1054
 
                           'verify_certificates': a_verify_certificates,
1055
 
                           }
 
1045
            credentials = dict(name=auth_def_name,
 
1046
                               user=a_user, password=auth_def['password'],
 
1047
                               verify_certificates=a_verify_certificates)
1056
1048
            self.decode_password(credentials,
1057
1049
                                 auth_def.get('password_encoding', None))
1058
1050
            if 'auth' in debug.debug_flags: