diff --git a/core/src/trezor/loop.py b/core/src/trezor/loop.py index ddaa38b4e..655ab97ee 100644 --- a/core/src/trezor/loop.py +++ b/core/src/trezor/loop.py @@ -88,7 +88,7 @@ def finalize(task: Task, value: Any) -> None: def close(task: Task) -> None: """ - Deschedule and unblock a task, close it so it can release all resources, and + Unschedule and unblock a task, close it so it can release all resources, and call its finalizer. """ for iface in _paused: @@ -101,7 +101,7 @@ def close(task: Task) -> None: def run() -> None: """ Loop forever, stepping through scheduled tasks and awaiting I/O events - inbetween. Use `schedule` first to add a coroutine to the task queue. + in between. Use `schedule` first to add a coroutine to the task queue. Tasks yield back to the scheduler on any I/O, usually by calling `await` on a `Syscall`. """ @@ -150,19 +150,19 @@ def clear() -> None: def _step(task: Task, value: Any) -> None: """ - Step through the task by sending `value` to `Task`. This can result in either: + Step through the task by sending value to it. This can result in either: 1. The task raises an exception: a) StopIteration - - The Task is completed and we call finalize to finish it. + - The Task is completed and we call finalize() to finish it. b) Exception - - An error occurred. We still need to call finalize. + - An error occurred. We still need to call finalize(). 2. Task does not raise exception and returns either: a) Syscall - - Syscall.handle is called. + - Syscall.handle() is called. b) None - The Task is simply scheduled to continue. c) Something else - - That should not happen - error. + - This should not happen - error. """ try: if isinstance(value, BaseException): diff --git a/core/src/trezor/ui/__init__.py b/core/src/trezor/ui/__init__.py index cbe31315f..8705b09bd 100644 --- a/core/src/trezor/ui/__init__.py +++ b/core/src/trezor/ui/__init__.py @@ -252,7 +252,7 @@ class Layout(Component): async def __iter__(self) -> ResultValue: """ Run the layout and wait until it completes. Returns the result value. - Usually not overriden. + Usually not overridden. """ value = None try: @@ -282,7 +282,7 @@ class Layout(Component): run this layout. Tasks are executed in parallel. When one of them returns, the others are closed and `create_tasks` is called again. - Usually overriden to add another task to the list.""" + Usually overridden to add another tasks to the list.""" return self.handle_input(), self.handle_rendering() def handle_input(self) -> loop.Task: # type: ignore diff --git a/core/src/usb.py b/core/src/usb.py index b557241e2..d4bf6af88 100644 --- a/core/src/usb.py +++ b/core/src/usb.py @@ -11,8 +11,8 @@ iface_wire = io.WebUSB( ep_out=0x01, ) -# as the iface_vcp inteface needs 3 endpoints, we cannot use it simultaneously -# with the iface_webauthn inteface. +# as the iface_vcp interface can have at most 3 endpoints, we cannot use it simultaneously +# with the iface_webauthn interface. if __debug__: # interface used for debug messages with trezor wire protocol iface_debug = io.WebUSB(