~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Neil Santos
  • Date: 2010-03-04 02:43:41 UTC
  • mto: (5080.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5081.
  • Revision ID: neil_santos@users.sourceforge.net-20100304024341-ra7njxj4lzjb46rl
Removed separate lstat() and reverted LocalTransport and SFTPTransport's stat() methods to using lstat() internally.
Reworked how SFTPTransport's symlink() handles success and signals failure.
Removed lstat() declaration on the Transport base class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
            interpreted as a boolean. Returns True or False otherwise.
194
194
        """
195
195
        s = self._get_user_option(option_name)
196
 
        if s is None:
197
 
            # The option doesn't exist
198
 
            return None
199
 
        val = ui.bool_from_string(s)
200
 
        if val is None:
201
 
            # The value can't be interpreted as a boolean
202
 
            trace.warning('Value "%s" is not a boolean for "%s"',
203
 
                          s, option_name)
204
 
        return val
 
196
        return ui.bool_from_string(s)
205
197
 
206
198
    def get_user_option_as_list(self, option_name):
207
199
        """Get a generic option as a list - no special process, no default.
518
510
        self._write_config_file()
519
511
 
520
512
    def _write_config_file(self):
521
 
        path = self._get_filename()
522
 
        f = open(path, 'wb')
523
 
        osutils.copy_ownership_from_path(path)
 
513
        f = open(self._get_filename(), 'wb')
524
514
        self._get_parser().write(f)
525
515
        f.close()
526
516
 
820
810
            os.mkdir(parent_dir)
821
811
        trace.mutter('creating config directory: %r', path)
822
812
        os.mkdir(path)
823
 
        osutils.copy_ownership_from_path(path)
824
813
 
825
814
 
826
815
def config_dir():
1417
1406
 
1418
1407
 
1419
1408
class PlainTextCredentialStore(CredentialStore):
1420
 
    __doc__ = """Plain text credential store for the authentication.conf file"""
 
1409
    """Plain text credential store for the authentication.conf file."""
1421
1410
 
1422
1411
    def decode_password(self, credentials):
1423
1412
        """See CredentialStore.decode_password."""