refactor: rename tomlchecker and move to global settings variable

pull/861/head
Callum Leslie 3 years ago
parent 75c731ce5c
commit d2d593371b
No known key found for this signature in database
GPG Key ID: D382C4AFEECEAA90

@ -4,6 +4,8 @@ import toml
from rich.console import Console from rich.console import Console
import re import re
from typing import Tuple, Dict
from utils.console import handle_input from utils.console import handle_input
# from console import handle_input # from console import handle_input
@ -110,8 +112,9 @@ def check_vars(path, checks):
crawl_and_check(config, 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 global config
config = None
try: try:
template = toml.load(template_file) template = toml.load(template_file)
except Exception as error: 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__": if __name__ == "__main__":
check_toml(".config.template.toml", "config.toml") check_toml(".config.template.toml", "config.toml")
if __name__ == "__main__":
check_toml(".config.template.toml", "config.toml")
check_toml(".config.template.toml", "config.toml")

Loading…
Cancel
Save