Skip to content

Commit 161f5eb

Browse files
committed
formatting updates
1 parent d9d046b commit 161f5eb

30 files changed

+245
-200
lines changed

addKeyValuePairToCollection.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
skipColl = secrets.skipColl
1919

2020
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')
2931
args = parser.parse_args()
3032

3133
if args.key:
@@ -105,8 +107,9 @@
105107
addedMetadataElement['value'] = addedValue
106108
addedMetadataElement['language'] = addedLanguage
107109
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') + '.')
110113
provNoteElement = {}
111114
provNoteElement['key'] = 'dc.description.provenance'
112115
provNoteElement['value'] = provNote

addKeyValuePairToCommunity.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
skipColl = secrets.skipColl
1919

2020
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 community. 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 community. optional '
29+
'- if not provided, the script will ask for input')
2930
args = parser.parse_args()
3031

3132
if args.key:

addNewItemsToCollection.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@
2020
skipColl = secrets.skipColl
2121

2222
parser = argparse.ArgumentParser()
23-
parser.add_argument('-d', '--directory', help='the directory of files to be \
24-
ingested. optional - if not provided, the script will ask for input')
25-
parser.add_argument('-e', '--fileExtension', help='the extension of files to \
26-
be ingested. optional - if not provided, the script will ask for input')
27-
parser.add_argument('-i', '--handle', help='handle of the object to retreive. \
28-
optional - if not provided, the script will ask for input')
23+
parser.add_argument('-d', '--directory', help='the directory of files to be '
24+
'ingested. optional - if not provided, the script will '
25+
'ask for input')
26+
parser.add_argument('-e', '--fileExtension', help='the extension of files to '
27+
'be ingested. optional - if not provided, the script will '
28+
'ask for input')
29+
parser.add_argument('-i', '--handle', help='handle of the object to retreive. '
30+
'optional - if not provided, the script will ask for '
31+
'input')
2932
args = parser.parse_args()
3033

3134
if args.directory:

checkInventory.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ def main():
99
parser = argparse.ArgumentParser()
1010

1111
parser.add_argument('-i', '--inventory', required=True,
12-
help='csv file containing the inventory. the path, if \
13-
given, can be absolute or relative to this script')
12+
help='csv file containing the inventory. the path, if '
13+
'given, can be absolute or relative to this script')
1414

1515
parser.add_argument('-d', '--dataDir',
16-
help='directory containing the data. if omitted, data \
17-
will be read from the directory containing the \
18-
inventory file')
16+
help='directory containing the data. if omitted, data '
17+
'will be read from the directory containing the '
18+
'inventory file')
1919

2020
parser.add_argument('-f', '--field',
21-
help='field in the csv containing the fileNames. \
22-
default: name')
21+
help='field in the csv containing the fileNames. '
22+
'default: name')
2323

2424
parser.add_argument('-v', '--verbose', action='store_true',
2525
help='increase output verbosity')

compareTwoKeysInCommunity.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@
1616
skipColl = secrets.skipColl
1717

1818
parser = argparse.ArgumentParser()
19-
parser.add_argument('-1', '--key', help='the first key to be output. \
20-
optional - if not provided, the script will ask for input')
21-
parser.add_argument('-2', '--key2', help='the second key to be output. \
22-
optional - if not provided, the script will ask for input')
23-
parser.add_argument('-i', '--handle', help='handle of the community to \
24-
retreive. optional - if not provided, the script will ask for input')
19+
parser.add_argument('-1', '--key', help='the first key to be output. '
20+
'optional - if not provided, the script will ask for '
21+
'input')
22+
parser.add_argument('-2', '--key2', help='the second key to be output. '
23+
'optional - if not provided, the script will ask for '
24+
'input')
25+
parser.add_argument('-i', '--handle', help='handle of the community to '
26+
'retreive. optional - if not provided, the script will '
27+
'ask for input')
2528
args = parser.parse_args()
2629

2730
if args.key:

deleteKeyFromCollection.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
skipColl = secrets.skipColl
1919

2020
parser = argparse.ArgumentParser()
21-
parser.add_argument('-k', '--deletedKey', help='the key to be deleted. \
22-
optional - if not provided, the script will ask for input')
23-
parser.add_argument('-i', '--handle', help='handle of the collection to \
24-
retreive. optional - if not provided, the script will ask for input')
21+
parser.add_argument('-k', '--deletedKey', help='the key to be deleted. '
22+
'optional - if not provided, the script will ask for '
23+
'input')
24+
parser.add_argument('-i', '--handle', help='handle of the collection to '
25+
'retreive. optional - if not provided, the script will '
26+
'ask for input')
2527
args = parser.parse_args()
2628

2729
if args.deletedKey:

deleteKeyFromCommunity.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
skipColl = secrets.skipColl
1919

2020
parser = argparse.ArgumentParser()
21-
parser.add_argument('-k', '--deletedKey', help='the key to be deleted. \
22-
optional - if not provided, the script will ask for input')
23-
parser.add_argument('-i', '--handle', help='handle of the community to \
24-
retreive. optional - if not provided, the script will ask for input')
21+
parser.add_argument('-k', '--deletedKey', help='the key to be deleted. '
22+
'optional - if not provided, the script will ask for '
23+
'input')
24+
parser.add_argument('-i', '--handle', help='handle of the community to '
25+
'retreive. optional - if not provided, the script will '
26+
'ask for input')
2527
args = parser.parse_args()
2628

2729
if args.deletedKey:

deleteKeyValuePairFromCollection.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
skipColl = secrets.skipColl
1919

2020
parser = argparse.ArgumentParser()
21-
parser.add_argument('-k', '--deletedKey', help='the key to be deleted. \
22-
optional - if not provided, the script will ask for input')
23-
parser.add_argument('-v', '--deletedValue', help='the value to be deleted. \
24-
optional - if not provided, the script will ask for input')
25-
parser.add_argument('-i', '--handle', help='handle of the community to \
26-
retreive. optional - if not provided, the script will ask for input')
21+
parser.add_argument('-k', '--deletedKey', help='the key to be deleted. '
22+
'optional - if not provided, the script will ask for '
23+
'input')
24+
parser.add_argument('-v', '--deletedValue', help='the value to be deleted. '
25+
'optional - if not provided, the script will ask for '
26+
'input')
27+
parser.add_argument('-i', '--handle', help='handle of the community to '
28+
'retreive. optional - if not provided, the script will '
29+
'ask for input')
2730
args = parser.parse_args()
2831

2932
if args.deletedKey:

editBitstreamsNames.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
skipColl = secrets.skipColl
1919

2020
parser = argparse.ArgumentParser()
21-
parser.add_argument('-f', '--fileName', help='the name of the CSV with the \
22-
bitstream name changes. optional - if not provided, the script will ask for \
23-
input')
21+
parser.add_argument('-f', '--fileName', help='the name of the CSV with the '
22+
'bitstream name changes. optional - if not provided, the '
23+
'script will ask for input')
2424
args = parser.parse_args()
2525
if args.uri:
2626
fileName = args.fileName

exportCollectionMetadataToCSV.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
skipColl = secrets.skipColl
1717

1818
parser = argparse.ArgumentParser()
19-
parser.add_argument('-i', '--handle', help='handle of the collection to \
20-
retreive. optional - if not provided, the script will ask for input')
19+
parser.add_argument('-i', '--handle', help='handle of the collection to '
20+
'retreive. optional - if not provided, the script will '
21+
'ask for input')
2122
args = parser.parse_args()
2223

2324
if args.handle:
@@ -29,17 +30,9 @@
2930

3031
# authentication
3132
startTime = time.time()
32-
data = {'email': email, 'password': password}
33-
header = {'content-type': 'application/json', 'accept': 'application/json'}
34-
session = requests.post(baseURL + '/rest/login', headers=header,
35-
verify=verify, params=data).cookies['JSESSIONID']
36-
cookies = {'JSESSIONID': session}
33+
cookies, header = dsFunc.auth(email, password, baseURL, verify)
3734

38-
39-
status = requests.get(baseURL + '/rest/status', headers=header,
40-
cookies=cookies, verify=verify).json()
41-
userFullName = status['fullname']
42-
print('authenticated', userFullName)
35+
uName, authEmail = dsFunc.authConfirm(cookies, baseURL, header, verify)
4336

4437
endpoint = baseURL + '/rest/handle/' + handle
4538
collection = requests.get(endpoint, headers=header, cookies=cookies,

0 commit comments

Comments
 (0)