diff options
author | BonfaceKilz | 2021-03-22 16:56:22 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-03-23 01:14:37 +0300 |
commit | 938268a14774481855775ed61ea4cece9692d878 (patch) | |
tree | fb343b71d1e4fba1d10d1baded837a1cae4a34a7 /gn3 | |
parent | be75445b10c4f41d72c948a37af09f69828a7d8d (diff) | |
download | genenetwork3-938268a14774481855775ed61ea4cece9692d878.tar.gz |
Update where cached file is stored
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/file_utils.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gn3/file_utils.py b/gn3/file_utils.py index 4dcf296..5296613 100644 --- a/gn3/file_utils.py +++ b/gn3/file_utils.py @@ -5,6 +5,7 @@ import os import random import string import tarfile +import pathlib from functools import partial from typing import Dict @@ -90,6 +91,7 @@ def cache_ipfs_file(ipfs_file: str, if not os.path.exists(file_loc): client = ipfshttpclient.connect(ipfs_addr) client.get(ipfs_file, - target=os.path.join(cache_dir, - ipfs_file.split("ipfs/")[-1])) + target=pathlib.Path + (os.path.join(cache_dir, + ipfs_file.split("ipfs/")[-1])).parent) return file_loc |