Permalink
Browse files

Follow XDG when finding cache directory

  • Loading branch information...
mwilliamson committed Dec 16, 2012
1 parent 0c5b00a commit 924524a9260c6487533fb779d677831fb1b1188f
Showing with 5 additions and 2 deletions.
  1. +4 −1 blah/git.py
  2. +1 −1 setup.py
View
@@ -2,8 +2,11 @@
import os.path
import hashlib
+from xdg.BaseDirectory import save_cache_path
+
from blah.util import run
+
class Git(object):
name = "git"
directory_name = ".git"
@@ -32,7 +35,7 @@ def local_repo(self, working_directory):
return GitRepository(working_directory)
def _update_cache(self, repository_uri):
- cache_dir = os.environ.get("BLAH_CACHE_DIR", os.path.expanduser("~/.cache/blah"))
+ cache_dir = os.environ.get("BLAH_CACHE_DIR", save_cache_path("blah"))
repo_hash = hashlib.sha1(repository_uri).hexdigest()
cache_repo = os.path.join(cache_dir, repo_hash)
View
@@ -15,5 +15,5 @@ def read(fname):
url='http://github.com/mwilliamson/blah',
scripts=["scripts/blah"],
packages=['blah'],
- install_requires=["argparse==1.2.1", "nose==1.2.1"],
+ install_requires=["argparse==1.2.1", "nose==1.2.1", "pyxdg==0.25"],
)

0 comments on commit 924524a

Please sign in to comment.