|
14 | 14 |
|
15 | 15 | from pyclowder.datasets import get_file_list |
16 | 16 | from pyclowder.collections import get_datasets, get_child_collections |
17 | | -import api.v2.files as v2files |
| 17 | +import pyclowder.api.v2.files as v2files |
18 | 18 |
|
19 | 19 | from dotenv import load_dotenv |
20 | 20 | load_dotenv() |
@@ -42,7 +42,8 @@ def download(connector, host, key, fileid, intermediatefileid=None, ext="", toke |
42 | 42 | ext -- the file extension, the downloaded file will end with this extension |
43 | 43 | """ |
44 | 44 | if clowder_version >= 2.0: |
45 | | - v2files.download(connector, host, key, fileid, intermediatefileid, ext, token) |
| 45 | + inputfilename = v2files.download(connector, host, key, fileid, intermediatefileid, ext, token) |
| 46 | + return inputfilename |
46 | 47 | else: |
47 | 48 | connector.message_process({"type": "file", "id": fileid}, "Downloading file.") |
48 | 49 |
|
@@ -77,7 +78,8 @@ def download_info(connector, host, key, fileid, token=None): |
77 | 78 | """ |
78 | 79 |
|
79 | 80 | if clowder_version >= 2.0: |
80 | | - v2files.download_info(conector, host, key, fileid, token) |
| 81 | + result = v2files.download_info(connector, host, key, fileid, token) |
| 82 | + return result.json() |
81 | 83 | else: |
82 | 84 | url = '%sapi/files/%s/metadata?key=%s' % (host, fileid, key) |
83 | 85 | headers = {"Authorization": "Bearer " + token} |
|
0 commit comments