From 5d0172a46394bbe43d76158c37f1e47ce39907c5 Mon Sep 17 00:00:00 2001 From: Supreme-hub <60816807+Supreme-hub@users.noreply.github.com> Date: Sat, 30 Jul 2022 00:09:36 +0530 Subject: [PATCH] fixed formatting changes --- TTS/engine_wrapper.py | 6 +++--- reddit/subreddit.py | 2 +- utils/console.py | 3 ++- utils/subreddit.py | 2 +- utils/video.py | 2 +- video_creation/final_video.py | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/TTS/engine_wrapper.py b/TTS/engine_wrapper.py index 02ab37b..6d09c7a 100644 --- a/TTS/engine_wrapper.py +++ b/TTS/engine_wrapper.py @@ -60,9 +60,9 @@ class TTSEngine: self.call_tts("title", process_text(self.reddit_object["thread_title"])) processed_text = process_text(self.reddit_object["thread_post"]) if ( - processed_text != "" + processed_text != "" and settings.config["settings"]["storymode"] == True - ): + ): self.call_tts("posttext", processed_text) idx = None @@ -122,7 +122,7 @@ class TTSEngine: def call_tts(self, filename: str, text: str): self.tts_module.run( text, filepath=f"{self.path}/{filename}.mp3" - ) + ) # try: # self.length += MP3(f"{self.path}/{filename}.mp3").info.length # except (MutagenError, HeaderNotFoundError): diff --git a/reddit/subreddit.py b/reddit/subreddit.py index 9a675a6..716a7fa 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -55,7 +55,7 @@ def get_subreddit_threads(POST_ID: str): sub = settings.config["reddit"]["thread"]["subreddit"] print_substep(f"Using subreddit: r/{sub} from TOML config") subreddit_choice = sub - if (str(subreddit_choice).casefold().startswith("r/")): # removes the r/ from the input + if str(subreddit_choice).casefold().startswith("r/"): # removes the r/ from the input subreddit_choice = subreddit_choice[2:] subreddit = reddit.subreddit( subreddit_choice diff --git a/utils/console.py b/utils/console.py index c557b2a..647e131 100644 --- a/utils/console.py +++ b/utils/console.py @@ -117,4 +117,5 @@ def handle_input( return user_input console.print( "[red bold]" + err_message + "\nValid options are: " + ", ".join(map(str, options)) + "." - ) \ No newline at end of file + ) + \ No newline at end of file diff --git a/utils/subreddit.py b/utils/subreddit.py index 3ffafd9..fae4631 100644 --- a/utils/subreddit.py +++ b/utils/subreddit.py @@ -55,7 +55,7 @@ def get_subreddit_undone(submissions: list, subreddit, times_checked=0): return get_subreddit_undone( subreddit.top( - time_filter=VALID_TIME_FILTERS[index],limit=(50 if int(index) == 0 else index + 1 * 50), + time_filter=VALID_TIME_FILTERS[index],limit=(50 if int(index) == 0 else index + 1 * 50) ), subreddit, times_checked=index, diff --git a/utils/video.py b/utils/video.py index d892eb9..63dc170 100644 --- a/utils/video.py +++ b/utils/video.py @@ -35,7 +35,7 @@ class Video: return ImageClip(path) def add_watermark( - self, text, opacity=0.5, duration: int | float = 5, position: Tuple = (0.7, 0.9), fontsize=15, + self, text, opacity=0.5, duration: int | float = 5, position: Tuple = (0.7, 0.9), fontsize=15 ): compensation = round( (position[0] / ((len(text) * (fontsize / 5) / 1.5) / 100 + position[0] * position[0])), diff --git a/video_creation/final_video.py b/video_creation/final_video.py index eb7508b..fd12642 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -85,7 +85,7 @@ def make_final_video( image_clips = [] # Gather all images new_opacity = 1 if opacity is None or float(opacity) >= 1 else float(opacity) - new_transition = (0 if transition is None or float(transition) > 2 else float(transition)) + new_transition = 0 if transition is None or float(transition) > 2 else float(transition) image_clips.insert( 0, ImageClip("assets/temp/png/title.png")