Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Follow XDG when finding cache directory

  • Loading branch information...
commit 924524a9260c6487533fb779d677831fb1b1188f 1 parent 0c5b00a
@mwilliamson authored
Showing with 5 additions and 2 deletions.
  1. +4 −1 blah/git.py
  2. +1 −1  setup.py
View
5 blah/git.py
@@ -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
2  setup.py
@@ -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"],
)
Please sign in to comment.
Something went wrong with that request. Please try again.