mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-15 20:19:23 +00:00
use __iter__ instead of wait
This commit is contained in:
parent
b8dd8ed90c
commit
6991286f8b
@ -57,11 +57,9 @@ async def show_mnemonic(mnemonic):
|
||||
ui.display.text(45, top, '%s' % word, ui.BOLD, ui.WHITE, ui.BLACK)
|
||||
|
||||
if page + 1 == page_count:
|
||||
# wait for the finish button
|
||||
finish = Button((0, 240 - 48, 240, 48), 'Finish',
|
||||
normal_style=CONFIRM_BUTTON,
|
||||
active_style=CONFIRM_BUTTON_ACTIVE)
|
||||
await finish.wait()
|
||||
await Button((0, 240 - 48, 240, 48), 'Finish',
|
||||
normal_style=CONFIRM_BUTTON,
|
||||
active_style=CONFIRM_BUTTON_ACTIVE)
|
||||
else:
|
||||
await animate_swipe()
|
||||
|
||||
|
@ -113,7 +113,7 @@ class Button():
|
||||
if in_area(pos, self.area):
|
||||
return BTN_CLICKED
|
||||
|
||||
def wait(self):
|
||||
def __iter__(self):
|
||||
while True:
|
||||
self.render()
|
||||
event, *pos = yield loop.Select(loop.TOUCH)
|
||||
|
@ -33,7 +33,7 @@ class ConfirmDialog():
|
||||
if self.content is not None:
|
||||
return self.content.send(event, pos)
|
||||
|
||||
def wait(self):
|
||||
def __iter__(self):
|
||||
while True:
|
||||
self.render()
|
||||
event, *pos = yield loop.Select(loop.TOUCH)
|
||||
|
@ -15,6 +15,6 @@ async def confirm(content=None, code=None, **kwargs):
|
||||
if code is None:
|
||||
code = Other
|
||||
ack = await wire.call(ButtonRequest(code=code), ButtonAck)
|
||||
res = await dialog.wait()
|
||||
res = await dialog
|
||||
|
||||
return res == CONFIRMED
|
||||
|
Loading…
Reference in New Issue
Block a user