Reformat entire project with ruff instead of black

This commit is contained in:
Rapptz
2025-08-18 20:15:44 -04:00
parent 3ef6272e07
commit 44a44e938f
88 changed files with 485 additions and 730 deletions

View File

@ -72,7 +72,7 @@ __all__ = (
_log = logging.getLogger(__name__)
OPUS_SILENCE = b'\xF8\xFF\xFE'
OPUS_SILENCE = b'\xf8\xff\xfe'
c_int_ptr = ctypes.POINTER(ctypes.c_int)
c_int16_ptr = ctypes.POINTER(ctypes.c_int16)
@ -218,7 +218,7 @@ def libopus_loader(name: str) -> Any:
if item[3]:
func.errcheck = item[3]
except KeyError:
_log.exception("Error assigning check function to %s", func)
_log.exception('Error assigning check function to %s', func)
return lib
@ -476,16 +476,14 @@ class Decoder(_OpusStruct):
return ret.value
@overload
def decode(self, data: bytes, *, fec: bool) -> bytes:
...
def decode(self, data: bytes, *, fec: bool) -> bytes: ...
@overload
def decode(self, data: Literal[None], *, fec: Literal[False]) -> bytes:
...
def decode(self, data: Literal[None], *, fec: Literal[False]) -> bytes: ...
def decode(self, data: Optional[bytes], *, fec: bool = False) -> bytes:
if data is None and fec:
raise TypeError("Invalid arguments: FEC cannot be used with null data")
raise TypeError('Invalid arguments: FEC cannot be used with null data')
if data is None:
frame_size = self._get_last_packet_duration() or self.SAMPLES_PER_FRAME