~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Robert Collins
  • Date: 2005-10-11 07:21:00 UTC
  • mto: This revision was merged to the branch mainline in revision 1443.
  • Revision ID: robertc@robertcollins.net-20051011072100-16996b55c43ff24f
move editor into the config file too

Show diffs side-by-side

added added

removed removed

Lines of Context:
388
388
        return os.path.join(p1, p2)
389
389
    
390
390
 
391
 
def _read_config_value(name):
392
 
    """Read a config value from the file ~/.bzr.conf/<name>
393
 
    Return None if the file does not exist"""
394
 
    try:
395
 
        f = file(os.path.join(config_dir(), name), "r")
396
 
        return f.read().decode(bzrlib.user_encoding).rstrip("\r\n")
397
 
    except IOError, e:
398
 
        if e.errno == errno.ENOENT:
399
 
            return None
400
 
        raise
401
 
 
402
 
 
403
391
def split_lines(s):
404
392
    """Split s into lines, but without removing the newline characters."""
405
393
    return StringIO(s).readlines()