|
18 | 18 | skipColl = secrets.skipColl |
19 | 19 |
|
20 | 20 | parser = argparse.ArgumentParser() |
21 | | -parser.add_argument('-k', '--key', help='the key to be added. optional - if \ |
22 | | -not provided, the script will ask for input') |
23 | | -parser.add_argument('-v', '--value', help='the value to be added. optional - \ |
24 | | -if not provided, the script will ask for input') |
25 | | -parser.add_argument('-l', '--language', help='the language tag to be added. \ |
26 | | -optional - if not provided, the script will ask for input') |
27 | | -parser.add_argument('-i', '--handle', help='handle of the collection. optional \ |
28 | | -- if not provided, the script will ask for input') |
| 21 | +parser.add_argument('-k', '--key', help='the key to be added. optional - if ' |
| 22 | + 'not provided, the script will ask for input') |
| 23 | +parser.add_argument('-v', '--value', help='the value to be added. optional - ' |
| 24 | + 'if not provided, the script will ask for input') |
| 25 | +parser.add_argument('-l', '--language', help='the language tag to be added. ' |
| 26 | + 'optional - if not provided, the script will ask for ' |
| 27 | + 'input') |
| 28 | +parser.add_argument('-i', '--handle', help='handle of the collection. ' |
| 29 | + 'optional - if not provided, the script will ask for ' |
| 30 | + 'input') |
29 | 31 | args = parser.parse_args() |
30 | 32 |
|
31 | 33 | if args.key: |
|
53 | 55 | session = requests.post(baseURL + '/rest/login', headers=header, |
54 | 56 | verify=verify, params=data).cookies['JSESSIONID'] |
55 | 57 | cookies = {'JSESSIONID': session} |
56 | | -headerFileUpload = {'accept': 'application/json'} |
| 58 | + |
57 | 59 |
|
58 | 60 | status = requests.get(baseURL + '/rest/status', headers=header, |
59 | 61 | cookies=cookies, verify=verify).json() |
|
105 | 107 | addedMetadataElement['value'] = addedValue |
106 | 108 | addedMetadataElement['language'] = addedLanguage |
107 | 109 | itemMetadataProcessed.append(addedMetadataElement) |
108 | | - provNote = '\'' + addedKey + ': ' + addedValue + '\' was added through a \ |
109 | | - batch process on ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S') + '.' |
| 110 | + provNote = ('\'' + addedKey + ': ' + addedValue + '\' was added through a ' |
| 111 | + + 'batch process on ' |
| 112 | + + datetime.now().strftime('%Y-%m-%d %H:%M:%S') + '.') |
110 | 113 | provNoteElement = {} |
111 | 114 | provNoteElement['key'] = 'dc.description.provenance' |
112 | 115 | provNoteElement['value'] = provNote |
|
0 commit comments