mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-15 20:19:23 +00:00
core/ui: delete is_backup argument from RustLayout
This commit is contained in:
parent
5470c09348
commit
1ffbd410b5
@ -32,14 +32,10 @@ if __debug__:
|
||||
|
||||
class RustLayout(ui.Layout):
|
||||
# pylint: disable=super-init-not-called
|
||||
def __init__(self, layout: Any, is_backup: bool = False):
|
||||
def __init__(self, layout: Any):
|
||||
self.layout = layout
|
||||
self.timer = loop.Timer()
|
||||
self.layout.attach_timer_fn(self.set_timer)
|
||||
self.is_backup = is_backup
|
||||
|
||||
if __debug__ and self.is_backup:
|
||||
self.notify_backup()
|
||||
|
||||
def set_timer(self, token: int, deadline: int) -> None:
|
||||
self.timer.schedule(deadline, token)
|
||||
@ -105,27 +101,8 @@ class RustLayout(ui.Layout):
|
||||
if msg is not None:
|
||||
raise ui.Result(msg)
|
||||
|
||||
if self.is_backup:
|
||||
self.notify_backup()
|
||||
notify_layout_change(self)
|
||||
|
||||
def notify_backup(self):
|
||||
from apps.debug import reset_current_words
|
||||
|
||||
content = "\n".join(self.read_content())
|
||||
start = "< Paragraphs "
|
||||
end = ">"
|
||||
start_pos = content.index(start)
|
||||
end_pos = content.index(end, start_pos)
|
||||
words: list[str] = []
|
||||
for line in content[start_pos + len(start) : end_pos].split("\n"):
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
space_pos = line.index(" ")
|
||||
words.append(line[space_pos + 1 :])
|
||||
reset_current_words.publish(words)
|
||||
|
||||
else:
|
||||
|
||||
def create_tasks(self) -> tuple[loop.AwaitableTask, ...]:
|
||||
|
@ -73,7 +73,6 @@ async def show_share_words(
|
||||
title=title,
|
||||
pages=pages,
|
||||
),
|
||||
is_backup=True,
|
||||
),
|
||||
"backup_words",
|
||||
ButtonRequestType.ResetDevice,
|
||||
|
Loading…
Reference in New Issue
Block a user