Skip to content

Commit 4ef4685

Browse files
committed
pass in folder id to dataset
1 parent 8939ecc commit 4ef4685

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pyclowder/api/v2/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def upload_thumbnail(connector, client, fileid, thumbnail):
324324
logger.error("unable to upload thumbnail %s to file %s", thumbnail, fileid)
325325

326326

327-
def upload_to_dataset(connector, client, datasetid, filepath, folder_id=None, check_duplicate=False):
327+
def upload_to_dataset(connector, client, datasetid, filepath, check_duplicate=False, folder_id=None):
328328
"""Upload file to existing Clowder dataset.
329329
330330
Keyword arguments:

pyclowder/files.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def upload_thumbnail(connector, host, key, fileid, thumbnail):
256256
return thumbnail_id
257257

258258

259-
def upload_to_dataset(connector, host, key, datasetid, filepath, check_duplicate=False):
259+
def upload_to_dataset(connector, host, key, datasetid, filepath, check_duplicate=False, folder_id=None):
260260
"""Upload file to existing Clowder dataset.
261261
262262
Keyword arguments:
@@ -266,10 +266,11 @@ def upload_to_dataset(connector, host, key, datasetid, filepath, check_duplicate
266266
datasetid -- the dataset that the file should be associated with
267267
filepath -- path to file
268268
check_duplicate -- check if filename already exists in dataset and skip upload if so
269+
folder_id -- the folder that the file should be associated with
269270
"""
270271
client = ClowderClient(host=host, key=key)
271272
if clowder_version == 2:
272-
return files.upload_to_dataset(connector, client, datasetid, filepath, check_duplicate)
273+
return files.upload_to_dataset(connector, client, datasetid, filepath, check_duplicate, folder_id)
273274
else:
274275
logger = logging.getLogger(__name__)
275276

0 commit comments

Comments
 (0)