Moved id to utils

pull/1091/head
Simon 3 years ago committed by GitHub
parent 3afdc38cb4
commit d11b177344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,7 +9,7 @@ from prawcore import ResponseException
from reddit.subreddit import get_subreddit_threads
from utils.cleanup import cleanup
from utils.console import print_markdown, print_step, print_substep
from utils import settings
from utils import settings, id
from video_creation.background import (
download_background,
@ -51,13 +51,6 @@ def main(POST_ID=None):
chop_background_video(bg_config, length, reddit_object)
make_final_video(number_of_comments, length, reddit_object, bg_config)
def id(reddit_obj: dict):
"""
This function takes a reddit object and returns the post id
"""
id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"])
print_substep(f"Thread ID is {id}", style="bold blue")
return id
def run_many(times):
for x in range(1, times + 1):

@ -0,0 +1,10 @@
import re
from utils import print_substep
def id(reddit_obj: dict):
"""
This function takes a reddit object and returns the post id
"""
id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"])
print_substep(f"Thread ID is {id}", style="bold blue")
return id
Loading…
Cancel
Save