Skip to content

Commit 1b5cda9

Browse files
committed
[DATALAD RUNCMD] Run black to harmonize formatting -- we should use pre-commit
=== Do not change lines below === { "chain": [], "cmd": "black tributors", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
1 parent b2c8151 commit 1b5cda9

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

tributors/main/orcid.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,15 @@ def record_search(url, email, interactive=False, search_type=""):
196196
skip_choices = ["s", "S", "skip"]
197197
enter_choices = ["e", "E", "enter"]
198198
quit_choices = ["q"]
199-
choices = [str(i) for i, _ in enumerate(results, 1)] + skip_choices + enter_choices + quit_choices
200-
prefix = "1:%s or s to skip, e to enter, q to quit the loop" % min(10, len(results))
199+
choices = (
200+
[str(i) for i, _ in enumerate(results, 1)]
201+
+ skip_choices
202+
+ enter_choices
203+
+ quit_choices
204+
)
205+
prefix = "1:%s or s to skip, e to enter, q to quit the loop" % min(
206+
10, len(results)
207+
)
201208
choice = choice_prompt(
202209
"Please enter a choice, or s to skip, e to enter.",
203210
choices=choices,
@@ -210,7 +217,7 @@ def record_search(url, email, interactive=False, search_type=""):
210217
if choice in enter_choices:
211218
return entry_prompt(
212219
f"Please enter the ORCID for {email}.",
213-
regex='[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]$',
220+
regex="[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]$",
214221
)
215222

216223
if not choice or choice in skip_choices:

tributors/utils/prompt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ def entry_prompt(prompt, regex=None):
5757
if entry and regex is not None and not re.match(regex, entry):
5858
entry = None
5959
message = r"Please enter a valid response. Should match regex {regex!r}"
60-
return entry
60+
return entry

0 commit comments

Comments
 (0)