style: formatted with black
This commit is contained in:
2 files changed
+12
-10
No files matched your search
+4
-1
@@ -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 get_check_value(key, default_result):
|
||||
return checks[key] if key in checks else default_result
|
||||
|
||||
incorrect = False
|
||||
if value == {}:
|
||||
incorrect = True
|
||||
@@ -102,7 +103,9 @@ def check(value, checks, name):
|
||||
err_message=get_check_value("input_error", "Incorrect input"),
|
||||
nmin=get_check_value("nmin", 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),
|
||||
optional=get_check_value("optional", False),
|
||||
)
|
||||
|
||||
@@ -26,15 +26,14 @@ console = Console()
|
||||
|
||||
W, H = 1080, 1920
|
||||
|
||||
def name_normalize(
|
||||
name: str
|
||||
) -> str:
|
||||
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?\/)', r' with', 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'\/', r'', name)
|
||||
|
||||
def name_normalize(name: str) -> str:
|
||||
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?\/)", r" with", 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"\/", r"", name)
|
||||
return name
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user