From 93f2e452ced3cdb4b92b69b0c34bcfdeee747098 Mon Sep 17 00:00:00 2001 From: rany2 Date: Wed, 27 Jul 2022 20:17:42 +0300 Subject: [PATCH] lint --- src/edge_tts/communicate.py | 8 ++++---- src/edge_tts/submaker.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/edge_tts/communicate.py b/src/edge_tts/communicate.py index e8f5a65..f81d063 100644 --- a/src/edge_tts/communicate.py +++ b/src/edge_tts/communicate.py @@ -242,7 +242,7 @@ class Communicate: word_boundary = str(word_boundary).lower() - websocket_max_size = 2**16 + websocket_max_size = 2 ** 16 overhead_per_message = ( len( ssml_headers_plus_data( @@ -337,9 +337,9 @@ class Communicate: metadata_duration = metadata["Metadata"][0]["Data"][ "Duration" ] - metadata_text = metadata["Metadata"][0]["Data"]["text"][ - "Text" - ] + metadata_text = metadata["Metadata"][0]["Data"][ + "text" + ]["Text"] yield ( [ metadata_offset, diff --git a/src/edge_tts/submaker.py b/src/edge_tts/submaker.py index 5a432c3..6988518 100644 --- a/src/edge_tts/submaker.py +++ b/src/edge_tts/submaker.py @@ -28,9 +28,9 @@ def mktimestamp(time_unit): Returns: str: The timecode of the subtitle. """ - hour = math.floor(time_unit / 10**7 / 3600) - minute = math.floor((time_unit / 10**7 / 60) % 60) - seconds = (time_unit / 10**7) % 60 + hour = math.floor(time_unit / 10 ** 7 / 3600) + minute = math.floor((time_unit / 10 ** 7 / 60) % 60) + seconds = (time_unit / 10 ** 7) % 60 return f"{hour:02d}:{minute:02d}:{seconds:06.3f}" @@ -48,7 +48,7 @@ class SubMaker: subtitles should overlap. """ self.subs_and_offset = [] - self.overlapping = overlapping * (10**7) + self.overlapping = overlapping * (10 ** 7) def create_sub(self, timestamp, text): """