mirror of
https://github.com/google/bumble.git
synced 2026-04-16 00:25:31 +00:00
fix types
This commit is contained in:
@@ -222,9 +222,8 @@ def find_endpoints(device, forced_mode, sco_alternate=None):
|
|||||||
|
|
||||||
|
|
||||||
class UsbPacketSink:
|
class UsbPacketSink:
|
||||||
def __init__(self, device, bulk_out, isochronous_out):
|
def __init__(self, device, bulk_out, isochronous_out) -> None:
|
||||||
self.device = device
|
self.device = device
|
||||||
self.packets = asyncio.Queue[bytes]() # Queue of packets waiting to be sent
|
|
||||||
self.bulk_out = bulk_out
|
self.bulk_out = bulk_out
|
||||||
self.isochronous_out = isochronous_out
|
self.isochronous_out = isochronous_out
|
||||||
self.bulk_or_control_out_transfer = device.getTransfer()
|
self.bulk_or_control_out_transfer = device.getTransfer()
|
||||||
|
|||||||
@@ -275,18 +275,17 @@ async def main() -> None:
|
|||||||
output_file_name = sys.argv[5]
|
output_file_name = sys.argv[5]
|
||||||
|
|
||||||
global input_wav, output_wav
|
global input_wav, output_wav
|
||||||
with (
|
input_cm: contextlib.AbstractContextManager[wave.Wave_read | None] = (
|
||||||
(
|
wave.open(input_file_name, "rb")
|
||||||
wave.open(input_file_name, "rb")
|
if input_file_name
|
||||||
if input_file_name
|
else contextlib.nullcontext(None)
|
||||||
else contextlib.nullcontext(None)
|
)
|
||||||
) as input_wav,
|
output_cm: contextlib.AbstractContextManager[wave.Wave_write | None] = (
|
||||||
(
|
wave.open(output_file_name, "wb")
|
||||||
wave.open(output_file_name, "wb")
|
if output_file_name
|
||||||
if output_file_name
|
else contextlib.nullcontext(None)
|
||||||
else contextlib.nullcontext(None)
|
)
|
||||||
) as output_wav,
|
with input_cm as input_wav, output_cm as output_wav:
|
||||||
):
|
|
||||||
if input_wav and input_wav.getnchannels() != 1:
|
if input_wav and input_wav.getnchannels() != 1:
|
||||||
print("Mono input required")
|
print("Mono input required")
|
||||||
return
|
return
|
||||||
|
|||||||
2
tasks.py
2
tasks.py
@@ -170,7 +170,9 @@ def format_code(ctx, check=False, diff=False):
|
|||||||
@task
|
@task
|
||||||
def check_types(ctx):
|
def check_types(ctx):
|
||||||
checklist = ["apps", "bumble", "examples", "tests", "tasks.py"]
|
checklist = ["apps", "bumble", "examples", "tests", "tasks.py"]
|
||||||
|
print(">>> Running the type checker...")
|
||||||
try:
|
try:
|
||||||
|
print("+++ Checking with mypy...")
|
||||||
ctx.run(f"mypy {' '.join(checklist)}")
|
ctx.run(f"mypy {' '.join(checklist)}")
|
||||||
except UnexpectedExit as exc:
|
except UnexpectedExit as exc:
|
||||||
print("Please check your code against the mypy messages.")
|
print("Please check your code against the mypy messages.")
|
||||||
|
|||||||
Reference in New Issue
Block a user