~lifeless/bzr/bug-423818

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-08-20 08:02:26 UTC
  • mfrom: (4584.3.32 apport)
  • Revision ID: pqm@pqm.ubuntu.com-20090820080226-97krol4wohcyh2ba
(mbp) re-add apport support

Show diffs side-by-side

added added

removed removed

Lines of Context:
821
821
    return osutils.pathjoin(config_dir(), 'ignore')
822
822
 
823
823
 
 
824
def crash_dir():
 
825
    """Return the directory name to store crash files.
 
826
 
 
827
    This doesn't implicitly create it.
 
828
 
 
829
    On Windows it's in the config directory; elsewhere in the XDG cache directory.
 
830
    """
 
831
    if sys.platform == 'win32':
 
832
        return osutils.pathjoin(config_dir(), 'Crash')
 
833
    else:
 
834
        return osutils.pathjoin(xdg_cache_dir(), 'crash')
 
835
 
 
836
 
 
837
def xdg_cache_dir():
 
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')
 
845
 
 
846
 
824
847
def _auto_user_id():
825
848
    """Calculate automatic user identification.
826
849