1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00

core: rename close_default to a more appropriate kill_default

This commit is contained in:
matejcik 2019-11-04 15:32:50 +01:00 committed by matejcik
parent ca484b2c06
commit a3930d4bdb
2 changed files with 9 additions and 3 deletions

View File

@ -59,7 +59,7 @@ def _start_progress() -> None:
# Because we are drawing to the screen manually, without a layout, we
# should make sure that no other layout is running. At this point, only
# the homescreen should be on, so shut it down.
workflow.close_default()
workflow.kill_default()
ui.backlight_fade(ui.BACKLIGHT_DIM)
ui.display.clear()
ui.header("Please wait")

View File

@ -79,9 +79,15 @@ def replace_default(constructor: Callable[[], loop.Task]) -> None:
loop.finalize(default_task, None) # TODO: why not close_default()
start_default(constructor)
def kill_default() -> None:
"""Forcefully shut down default task.
def close_default() -> None:
"""Explicitly close the default workflow task."""
The purpose of the call is to prevent the default task from interfering with
a synchronous layout-less workflow (e.g., the progress bar in `mnemonic.get_seed`).
This function should only be called from a workflow registered with `on_start`.
Otherwise the default will be restarted immediately.
"""
if default_task:
if __debug__:
log.debug(__name__, "close default")