fixes after self review

pull/1070/head
Drugsosos 3 years ago
parent 7ca565eb8d
commit 1d86a8762c
No known key found for this signature in database
GPG Key ID: 8E35176FE617E28D

@ -1,5 +1,4 @@
[reddit]
[reddit.creds]
[reddit.creds.client_id]
optional = false
@ -45,7 +44,6 @@ default = false
explanation = "Whether you have Reddit 2FA enabled, Valid options are True and False"
example = true
[reddit.thread]
[reddit.thread.random]
optional = true
@ -150,7 +148,6 @@ example = false
options = [true, false]
explanation = "not yet implemented"
[settings.background]
[settings.background.background_choice]
optional = true
@ -174,8 +171,6 @@ explanation = "Sets the background for the video"
#example = 0.1
#explanation="Sets the volume of the background audio. only used if the background_audio is also set to true"
[settings.tts]
[settings.tts.choice]
optional = false

@ -154,7 +154,7 @@ def check_vars(
checks: dict,
) -> None:
"""
Checks if value is in nested dict and correct by path of keys
Checks if there is the value in the dict and it's correct
Args:
path: List with path
@ -204,9 +204,9 @@ def check_config_wrapper(
return False
console.print("Unable to read config, and not allowed to overwrite it. Giving up.")
return False
# except Exception as error:
# console.print(f"[red bold]Encountered error when trying to to load {kwargs['template_name']}: {error}")
# return False
except Exception as error:
console.print(f"[red bold]Encountered error when trying to to load {kwargs['template_name']}: {error}")
return False
return wrapper
@ -248,6 +248,16 @@ def check_config(
config = toml.load(config_name)
template = toml.load(template_name)
console.print(
"""\
[blue bold]###############################
# #
# Checking TOML configuration #
# #
###############################
If you see any prompts, that means that you have unset/incorrectly set variables, please input the correct values.\
"""
)
crawl(template, check_vars)
with open(config_name, "w") as f:
toml.dump(config, f)

Loading…
Cancel
Save