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

@ -154,7 +154,7 @@ def check_vars(
checks: dict, checks: dict,
) -> None: ) -> 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: Args:
path: List with path path: List with path
@ -204,9 +204,9 @@ def check_config_wrapper(
return False return False
console.print("Unable to read config, and not allowed to overwrite it. Giving up.") console.print("Unable to read config, and not allowed to overwrite it. Giving up.")
return False return False
# except Exception as error: except Exception as error:
# console.print(f"[red bold]Encountered error when trying to to load {kwargs['template_name']}: {error}") console.print(f"[red bold]Encountered error when trying to to load {kwargs['template_name']}: {error}")
# return False return False
return wrapper return wrapper
@ -248,6 +248,16 @@ def check_config(
config = toml.load(config_name) config = toml.load(config_name)
template = toml.load(template_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) crawl(template, check_vars)
with open(config_name, "w") as f: with open(config_name, "w") as f:
toml.dump(config, f) toml.dump(config, f)

Loading…
Cancel
Save