diff --git a/src/apps/common/request_pin.py b/src/apps/common/request_pin.py index 3b52c5118..52672138b 100644 --- a/src/apps/common/request_pin.py +++ b/src/apps/common/request_pin.py @@ -2,17 +2,6 @@ from trezor import res from trezor import ui -def show_pin_timeout(wait, total): - ui.display.bar(0, 0, ui.SCREEN, ui.SCREEN, ui.BG) - ui.display.loader(1000 - (1000 * wait // total), -10, ui.FG, ui.BG) - if wait == 1: - s = 'Waiting for 1 second' - else: - s = 'Waiting for %d seconds' % wait - ui.display.text_center(ui.SCREEN // 2, ui.SCREEN - 20, s, ui.BOLD, ui.FG, ui.BG) - ui.display.refresh() - - class PinCancelled(Exception): pass diff --git a/src/apps/management/change_pin.py b/src/apps/management/change_pin.py index 5429021c5..31fe8617a 100644 --- a/src/apps/management/change_pin.py +++ b/src/apps/management/change_pin.py @@ -1,6 +1,6 @@ from trezor import ui from trezor import config -from trezor.pin import pin_to_int +from trezor.pin import pin_to_int, show_pin_timeout from trezor.utils import unimport @@ -53,7 +53,6 @@ async def layout_change_pin(ctx, msg): from trezor.messages.Success import Success from trezor.messages.Failure import Failure from trezor.messages.FailureType import PinInvalid - from apps.common.request_pin import show_pin_timeout await confirm_change_pin(ctx, msg) diff --git a/src/boot.py b/src/boot.py index 12823984b..68e5b9c4f 100644 --- a/src/boot.py +++ b/src/boot.py @@ -1,9 +1,9 @@ from trezor import config -from trezor.pin import pin_to_int +from trezor.pin import pin_to_int, show_pin_timeout from trezor import loop from trezor import ui -from apps.common.request_pin import request_pin, show_pin_timeout +from apps.common.request_pin import request_pin async def unlock_layout(): diff --git a/src/trezor/pin.py b/src/trezor/pin.py index f2e72341a..97bc94d34 100644 --- a/src/trezor/pin.py +++ b/src/trezor/pin.py @@ -1,6 +1,9 @@ -from trezor import config -from trezor import log - - def pin_to_int(pin): - return int('1'+pin) + return int('1' + pin) + +def show_pin_timeout(wait, total): + from trezor import ui + ui.display.bar(0, 0, ui.SCREEN, ui.SCREEN, ui.BG) + ui.display.loader(1000 - (1000 * wait // total), -10, ui.FG, ui.BG) + ui.display.text_center(ui.SCREEN // 2, ui.SCREEN - 20, 'Waiting for %d s' % wait, ui.BOLD, ui.FG, ui.BG) + ui.display.refresh()