Fix pylint config and reformat

Signed-off-by: rany2 <rany2@riseup.net>
This commit is contained in:
rany2
2024-02-16 18:05:02 +02:00
parent 09956e3a20
commit df6bac8b54
3 changed files with 8 additions and 8 deletions

View File

@@ -307,8 +307,8 @@ min-public-methods=2
[EXCEPTIONS] [EXCEPTIONS]
# Exceptions that will emit a warning when caught. # Exceptions that will emit a warning when caught.
overgeneral-exceptions=BaseException, overgeneral-exceptions=builtins.BaseException,
Exception builtins.Exception
[FORMAT] [FORMAT]

View File

@@ -2,7 +2,6 @@
Communicate package. Communicate package.
""" """
import json import json
import re import re
import ssl import ssl
@@ -152,7 +151,9 @@ def split_text_by_byte_length(
yield new_text yield new_text
def mkssml(text: Union[str, bytes], voice: str, rate: str, volume: str, pitch: str) -> str: def mkssml(
text: Union[str, bytes], voice: str, rate: str, volume: str, pitch: str
) -> str:
""" """
Creates a SSML string from the given parameters. Creates a SSML string from the given parameters.

View File

@@ -2,7 +2,6 @@
Main package. Main package.
""" """
import argparse import argparse
import asyncio import asyncio
import sys import sys
@@ -60,9 +59,9 @@ async def _run_tts(args: Any) -> None:
pitch=args.pitch, pitch=args.pitch,
) )
subs: SubMaker = SubMaker() subs: SubMaker = SubMaker()
with open( with (
args.write_media, "wb" open(args.write_media, "wb") if args.write_media else sys.stdout.buffer
) if args.write_media else sys.stdout.buffer as audio_file: ) as audio_file:
async for chunk in tts.stream(): async for chunk in tts.stream():
if chunk["type"] == "audio": if chunk["type"] == "audio":
audio_file.write(chunk["data"]) audio_file.write(chunk["data"])