Skip to content

Commit 78f78e4

Browse files
committed
Consistent behavior for edit api
1 parent 54285c1 commit 78f78e4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

caltechdata_write/caltechdata_edit.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
def Caltechdata_edit(token,ids,metadata={},files={},delete={},production=False):
77

8-
#Currently only replaces files
8+
#Including files will only replaces files if they have the same name
9+
#The delete option will delete any existing files with a given file
10+
#extension
911
#There are more file operations that could be implemented
1012

1113
#If files is a string - change to single value array
@@ -65,7 +67,7 @@ def Caltechdata_edit(token,ids,metadata={},files={},delete={},production=False):
6567

6668
c = session()
6769
response = c.post(url, headers=headers, data=dat)
68-
print(response.text)
70+
return response.text
6971

7072
def Caltechdata_add(token,ids,metadata={},files={},production=False):
7173

edit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
metaf = open(args.json_file[0], 'r')
1717
metadata = json.load(metaf)
1818

19-
Caltechdata_edit(token, args.ids, metadata, args.fnames, {}, False)
19+
response = Caltechdata_edit(token, args.ids, metadata, args.fnames, {}, False)
20+
print(response)

0 commit comments

Comments
 (0)