From 10f1d6ba73159c14e3869c6a87615be0e3b76b56 Mon Sep 17 00:00:00 2001 From: IanCa Date: Thu, 30 Jun 2022 16:18:14 -0500 Subject: [PATCH] Update default hed_cache location/tweak readme --- README.md | 10 ++++------ hed/schema/hed_cache.py | 7 +++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 71a3eb3b1..29fe45fab 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,11 @@ The [Github pull request](https://github.com/hed-standard/hed-python/pulls) may also be used for contributions. Usually these updates should be made to the `develop` branch, not the `master`. -### Support for earlier versions of HED (HED-2G) - -**Note:** As of January 1, 2022, the `hed-python` repository will no longer support HED-2G. -The existing support continues to be available in the `hed2-python` repository. -An on online version of the HED-2G tools are available at -[https://hedtools.ucsd.edu/hed2](https://hedtools.ucsd.edu/hed2) +#### Local Settings Storage +Cached Schemas by default are stored in "home/.hedtools/" +Location of "home" directory varies by OS. +Use hed.schema.set_cache_directory to change the location. ### Other links of interest diff --git a/hed/schema/hed_cache.py b/hed/schema/hed_cache.py index a956689c4..975fece65 100644 --- a/hed/schema/hed_cache.py +++ b/hed/schema/hed_cache.py @@ -1,4 +1,4 @@ -""" Infrastructure for caching HED schema. """ +"""Infrastructure for caching HED schema from remote repositories.""" import os import urllib.request @@ -11,8 +11,7 @@ import portalocker import time from hed.schema.schema_io.schema_util import url_to_file - -"""Infrastructure for caching HED schema from remote repositories.""" +from pathlib import Path # From https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string HED_VERSION_P1 = r"(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)" @@ -33,7 +32,7 @@ DEFAULT_SKIP_FOLDERS = ('deprecated', ) -HED_CACHE_DIRECTORY = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../validator/hed_cache/') +HED_CACHE_DIRECTORY = os.path.join(Path.home(), '.hedtools/hed_cache/') TIMESTAMP_FILENAME = "last_update.txt" CACHE_TIME_THRESHOLD = 300 * 6