Skip to content

Commit 0f5add5

Browse files
committed
Formatting
1 parent 079020d commit 0f5add5

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

caltechdata_api/cli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def decrypt_token(encrypted_token, key):
6262
# Function to get or set token
6363
def get_or_set_token(production=True):
6464
key = load_or_generate_key()
65-
65+
6666
# Use different token files for production and test environments
6767
token_filename = "token.txt" if production else "token_test.txt"
6868
token_file = os.path.join(caltechdata_directory, token_filename)
@@ -74,8 +74,12 @@ def get_or_set_token(production=True):
7474
return token
7575
except FileNotFoundError:
7676
while True:
77-
token = input(f"Enter your {'Production' if production else 'Test'} CaltechDATA token: ").strip()
78-
confirm_token = input(f"Confirm your {'Production' if production else 'Test'} CaltechDATA token: ").strip()
77+
token = input(
78+
f"Enter your {'Production' if production else 'Test'} CaltechDATA token: "
79+
).strip()
80+
confirm_token = input(
81+
f"Confirm your {'Production' if production else 'Test'} CaltechDATA token: "
82+
).strip()
7983
if token == confirm_token:
8084
encrypted_token = encrypt_token(token, key)
8185
with open(token_file, "wb") as f:

outdated/test_community.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,20 @@
55
url = "https://data.caltechlibrary.dev/"
66

77
headers = {
8-
"Authorization": "Bearer %s" % token,
9-
"Content-type": "application/json",
10-
}
11-
12-
data = {
13-
"payload": {
14-
"content": "I want this record to be in!",
15-
"format": "html"
16-
}
8+
"Authorization": "Bearer %s" % token,
9+
"Content-type": "application/json",
1710
}
1811

12+
data = {"payload": {"content": "I want this record to be in!", "format": "html"}}
13+
1914
result = requests.post(
20-
url + "/api/records/cxc6m-bef55/draft/actions/submit-review", headers=headers, json=data
21-
)
15+
url + "/api/records/cxc6m-bef55/draft/actions/submit-review",
16+
headers=headers,
17+
json=data,
18+
)
2219

2320
print(result.status_code)
2421
print(result.text)
25-
#if result.status_code != 201:
22+
# if result.status_code != 201:
2623
# print(result.text)
2724
# exit()
28-

0 commit comments

Comments
 (0)