Skip to content

Commit

Permalink
Make the data directory variable public as DATA_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
H0R5E committed Jan 16, 2025
1 parent c8f5b9a commit 3da8f38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/dtocean-data/src/dtocean_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"nemoh-{}-v2024.12.2".format(_ARCH)
)
_VERSION = version("dtocean-data")
_USER_DIR = UserDataPath("dtocean_data", "DTOcean", _VERSION)
DATA_DIR = UserDataPath("dtocean_data", "DTOcean", _VERSION)


def install(options: Sequence[str]):
Expand Down Expand Up @@ -54,9 +54,9 @@ def _extract_linux(url_base: str):
tmp_tg_path = tmp_dir_path / "tempfile.tar.gz"
_download_archive(tg_url, tmp_tg_path)

_USER_DIR.mkdir(exist_ok=True)
DATA_DIR.mkdir(exist_ok=True)
tar = tarfile.open(tmp_tg_path)
tar.extractall(path=_USER_DIR, filter="tar")
tar.extractall(path=DATA_DIR, filter="tar")
tar.close()


Expand All @@ -68,9 +68,9 @@ def _extract_windows(url_base: str):
tmp_zip_path = tmp_dir_path / "tempfile.zip"
_download_archive(zip_url, tmp_zip_path)

_USER_DIR.mkdir(exist_ok=True)
DATA_DIR.mkdir(exist_ok=True)
zf = ZipFile(tmp_zip_path)
zf.extractall(path=_USER_DIR)
zf.extractall(path=DATA_DIR)
zf.close()


Expand Down

0 comments on commit 3da8f38

Please sign in to comment.