Merge pull request #1205 from StopmotionSimonYT/config

Added full path check of .config.template.toml
pull/1220/head
Jason 3 years ago committed by GitHub
commit f44d4f3520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,6 +4,7 @@ import sys
from os import name from os import name
from subprocess import Popen from subprocess import Popen
from pathlib import Path
from prawcore import ResponseException from prawcore import ResponseException
from reddit.subreddit import get_subreddit_threads from reddit.subreddit import get_subreddit_threads
@ -77,7 +78,8 @@ def shutdown():
if __name__ == "__main__": if __name__ == "__main__":
assert sys.version_info >= (3, 9), "Python 3.10 or higher is required" assert sys.version_info >= (3, 9), "Python 3.10 or higher is required"
config = settings.check_toml("utils/.config.template.toml", "config.toml") directory = Path().absolute()
config = settings.check_toml(f"{directory}/utils/.config.template.toml", "config.toml")
config is False and exit() config is False and exit()
try: try:
if len(config["reddit"]["thread"]["post_id"].split("+")) > 1: if len(config["reddit"]["thread"]["post_id"].split("+")) > 1:

@ -1,7 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
import re import re
from typing import Tuple, Dict from typing import Tuple, Dict
from pathlib import Path
import toml import toml
from rich.console import Console from rich.console import Console
@ -159,4 +159,5 @@ If you see any prompts, that means that you have unset/incorrectly set variables
if __name__ == "__main__": if __name__ == "__main__":
check_toml("utils/.config.template.toml", "config.toml") directory = Path().absolute()
check_toml(f"{directory}/utils/.config.template.toml", "config.toml")

Loading…
Cancel
Save