refactor: rename tomlchecker and move to global settings variable

This commit is contained in:
Callum Leslie committed 2022-07-05 21:37:37 +01:00
1 parent 75c731ce5c
commit d2d593371b
1 file changed
+4 -5
+4 -5
View File
@@ -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")