diff --git a/utils/settings.py b/utils/settings.py index afd2ec0..07cebd4 100755 --- a/utils/settings.py +++ b/utils/settings.py @@ -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), ) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 5938235..1c5e781 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -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