1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-05-02 23:19:08 +00:00

core: fix docs typos

This commit is contained in:
Tomas Susanka 2019-08-21 15:12:21 +02:00
parent 4323b0ac2a
commit c9a78d7bcb
3 changed files with 11 additions and 11 deletions

View File

@ -88,7 +88,7 @@ def finalize(task: Task, value: Any) -> None:
def close(task: Task) -> 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. call its finalizer.
""" """
for iface in _paused: for iface in _paused:
@ -101,7 +101,7 @@ def close(task: Task) -> None:
def run() -> None: def run() -> None:
""" """
Loop forever, stepping through scheduled tasks and awaiting I/O events 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 Tasks yield back to the scheduler on any I/O, usually by calling `await` on
a `Syscall`. a `Syscall`.
""" """
@ -150,19 +150,19 @@ def clear() -> None:
def _step(task: Task, value: Any) -> 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: 1. The task raises an exception:
a) StopIteration 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 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: 2. Task does not raise exception and returns either:
a) Syscall a) Syscall
- Syscall.handle is called. - Syscall.handle() is called.
b) None b) None
- The Task is simply scheduled to continue. - The Task is simply scheduled to continue.
c) Something else c) Something else
- That should not happen - error. - This should not happen - error.
""" """
try: try:
if isinstance(value, BaseException): if isinstance(value, BaseException):

View File

@ -252,7 +252,7 @@ class Layout(Component):
async def __iter__(self) -> ResultValue: async def __iter__(self) -> ResultValue:
""" """
Run the layout and wait until it completes. Returns the result value. Run the layout and wait until it completes. Returns the result value.
Usually not overriden. Usually not overridden.
""" """
value = None value = None
try: try:
@ -282,7 +282,7 @@ class Layout(Component):
run this layout. Tasks are executed in parallel. When one of them run this layout. Tasks are executed in parallel. When one of them
returns, the others are closed and `create_tasks` is called again. 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() return self.handle_input(), self.handle_rendering()
def handle_input(self) -> loop.Task: # type: ignore def handle_input(self) -> loop.Task: # type: ignore

View File

@ -11,8 +11,8 @@ iface_wire = io.WebUSB(
ep_out=0x01, ep_out=0x01,
) )
# as the iface_vcp inteface needs 3 endpoints, we cannot use it simultaneously # as the iface_vcp interface can have at most 3 endpoints, we cannot use it simultaneously
# with the iface_webauthn inteface. # with the iface_webauthn interface.
if __debug__: if __debug__:
# interface used for debug messages with trezor wire protocol # interface used for debug messages with trezor wire protocol
iface_debug = io.WebUSB( iface_debug = io.WebUSB(