~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Martin Pool
  • Date: 2009-08-20 04:53:23 UTC
  • mto: This revision was merged to the branch mainline in revision 4632.
  • Revision ID: mbp@sourcefrog.net-20090820045323-4hsicfa87pdq3l29
Correction to xdg_cache_dir and add a simple test

Show diffs side-by-side

added added

removed removed

Lines of Context:
835
835
 
836
836
 
837
837
def xdg_cache_dir():
838
 
    # XXX: this should probably look at some environment variables too?
839
 
    return osutils.pathjoin(os.path.expanduser('~'),
840
 
        '.cache', 'bazaar')
 
838
    # See http://standards.freedesktop.org/basedir-spec/latest/ar01s03.html
 
839
    # Possibly this should be different on Windows?
 
840
    e = os.environ.get('XDG_CACHE_DIR', None)
 
841
    if e:
 
842
        return e
 
843
    else:
 
844
        return os.path.expanduser('~/.cache')
841
845
 
842
846
 
843
847
def _auto_user_id():