style: formatted with black

pull/861/head
Callum Leslie 2 years ago
parent d0a7697256
commit 4ed5c58ab2
No known key found for this signature in database
GPG Key ID: D382C4AFEECEAA90

@ -25,6 +25,7 @@ def crawl(obj: dict, func=lambda x, y: print(x, y, end="\n"), path: list = []):
def check(value, checks, name): def check(value, checks, name):
def get_check_value(key, default_result): def get_check_value(key, default_result):
return checks[key] if key in checks else default_result return checks[key] if key in checks else default_result
incorrect = False incorrect = False
if value == {}: if value == {}:
incorrect = True incorrect = True
@ -102,7 +103,9 @@ def check(value, checks, name):
err_message=get_check_value("input_error", "Incorrect input"), err_message=get_check_value("input_error", "Incorrect input"),
nmin=get_check_value("nmin", None), nmin=get_check_value("nmin", None),
nmax=get_check_value("nmax", None), nmax=get_check_value("nmax", None),
oob_error=get_check_value("oob_error", "Input out of bounds(Value too high/low/long/short)"), oob_error=get_check_value(
"oob_error", "Input out of bounds(Value too high/low/long/short)"
),
options=get_check_value("options", None), options=get_check_value("options", None),
optional=get_check_value("optional", False), optional=get_check_value("optional", False),
) )

@ -26,15 +26,14 @@ console = Console()
W, H = 1080, 1920 W, H = 1080, 1920
def name_normalize(
name: str def name_normalize(name: str) -> str:
) -> str: name = re.sub(r'[?\\"%*:|<>]', "", name)
name = re.sub(r'[?\\"%*:|<>]', '', name) name = re.sub(r"( [w,W]\s?\/\s?[o,O,0])", r" without", name)
name = re.sub(r'( [w,W]\s?\/\s?[o,O,0])', r' without', name) name = re.sub(r"( [w,W]\s?\/)", r" with", name)
name = re.sub(r'( [w,W]\s?\/)', r' with', name) name = re.sub(r"([0-9]+)\s?\/\s?([0-9]+)", r"\1 of \2", name)
name = re.sub(r'([0-9]+)\s?\/\s?([0-9]+)', r'\1 of \2', name) name = re.sub(r"(\w+)\s?\/\s?(\w+)", r"\1 or \2", name)
name = re.sub(r'(\w+)\s?\/\s?(\w+)', r'\1 or \2', name) name = re.sub(r"\/", r"", name)
name = re.sub(r'\/', r'', name)
return name return name

Loading…
Cancel
Save