style: improved typehinting

pull/798/head
Jason 2 years ago
parent 90be9e09b3
commit 65e42f286d

@ -10,7 +10,7 @@ from utils.console import print_step
def check_done(
redditobj: Dict[str],
redditobj: Submission,
) -> Submission:
# don't set this to be run anyplace that isn't subreddit.py bc of inspect stack
"""Checks if the chosen post has already been generated
@ -21,7 +21,6 @@ def check_done(
Returns:
Dict[str]|None: Reddit object in args
"""
with open("./video_creation/data/videos.json", "r", encoding="utf-8") as done_vids_raw:
done_videos = json.load(done_vids_raw)
for video in done_videos:

@ -26,13 +26,13 @@ console = Console()
W, H = 1080, 1920
def make_final_video(number_of_clips: int, length: int, reddit_obj: Dict[str]):
def make_final_video(number_of_clips: int, length: int, reddit_obj: dict):
"""Gathers audio clips, gathers all screenshots, stitches them together and saves the final video to assets/temp
Args:
number_of_clips (int): Index to end at when going through the screenshots
length (int): Length of the video
reddit_obj (Dict[str]): The reddit object that contains the posts to read.
reddit_obj (dict): The reddit object that contains the posts to read.
"""
print_step("Creating the final video 🎥")
VideoFileClip.reW = lambda clip: clip.resize(width=W)

@ -17,14 +17,13 @@ from utils.console import print_step, print_substep
storymode = False
def download_screenshots_of_reddit_posts(reddit_object: Dict[str], screenshot_num: int):
def download_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: int):
"""Downloads screenshots of reddit posts as seen on the web. Downloads to assets/temp/png
Args:
reddit_object (Dict[str]): Reddit object received from reddit/subreddit.py
screenshot_num (int): Number of screenshots to downlaod
"""
print_step("Downloading screenshots of reddit posts...")
# ! Make sure the reddit screenshots folder exists

@ -24,7 +24,7 @@ TTSProviders = {
}
def save_text_to_mp3(reddit_obj: Dict[str]) -> Tuple[int, int]:
def save_text_to_mp3(reddit_obj) -> Tuple[int, int]:
"""Saves text to MP3 files.
Args:

Loading…
Cancel
Save