Skip to content

Commit

Permalink
Make use of unified cache directory
Browse files Browse the repository at this point in the history
  • Loading branch information
tjelvar-olsson committed Apr 24, 2019
1 parent 350e914 commit 7f10554
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Added
Changed
^^^^^^^

- Cache environment variable changed from DTOOL_HTTP_CACHE_DIRECTORY to DTOOL_CACHE_DIRECTORY
- Default cache directory changed from ``~/.cache/dtool/http`` to ``~/.cache/dtool``


Deprecated
^^^^^^^^^^
Expand Down
5 changes: 3 additions & 2 deletions dtool_http/storagebroker.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
get_config_value,
mkdir_parents,
generous_parse_uri,
DEFAULT_CACHE_PATH,
)

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -45,9 +46,9 @@ def __init__(self, uri, admin_metadata, config_path=None):
)

self._cache_abspath = get_config_value(
"DTOOL_HTTP_CACHE_DIRECTORY",
"DTOOL_CACHE_DIRECTORY",
config_path=config_path,
default=os.path.expanduser("~/.cache/dtool/http")
default=DEFAULT_CACHE_PATH
)

# Helper functions
Expand Down
4 changes: 3 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import tempfile
import threading
from contextlib import contextmanager
from urllib.parse import urlunparse

import dtoolcore
from dtoolcore.utils import urlunparse

import pytest


_HERE = os.path.dirname(__file__)
_DATA = os.path.join(_HERE, "data")

Expand Down

0 comments on commit 7f10554

Please sign in to comment.