From d2d593371bcde615469ed68c142eebd5afab6935 Mon Sep 17 00:00:00 2001 From: Callum Leslie Date: Tue, 5 Jul 2022 21:02:31 +0100 Subject: [PATCH] refactor: rename tomlchecker and move to global settings variable --- utils/settings.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utils/settings.py b/utils/settings.py index 927c500..d674974 100755 --- a/utils/settings.py +++ b/utils/settings.py @@ -4,6 +4,8 @@ import toml from rich.console import Console import re +from typing import Tuple, Dict + from utils.console import handle_input # from console import handle_input @@ -110,8 +112,9 @@ def check_vars(path, checks): crawl_and_check(config, path, checks) -def check_toml(template_file, config_file) -> (bool, dict): +def check_toml(template_file, config_file) -> Tuple[bool, Dict]: global config + config = None try: template = toml.load(template_file) except Exception as error: @@ -172,7 +175,3 @@ If you see any prompts, that means that you have unset/incorrectly set variables if __name__ == "__main__": check_toml(".config.template.toml", "config.toml") - -if __name__ == "__main__": - check_toml(".config.template.toml", "config.toml") - check_toml(".config.template.toml", "config.toml")