1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-11 23:22:50 +00:00
trezor-firmware/src/apps/management/recovery_device.py
2017-09-26 12:05:26 +02:00

24 lines
570 B
Python

from trezor import ui, wire
from trezor.utils import unimport
def nth(n):
if 4 <= n % 100 <= 20:
sfx = 'th'
else:
sfx = {1: 'st', 2: 'nd', 3: 'rd'}.get(n % 10, 'th')
return str(n) + sfx
@unimport
async def layout_recovery_device(ctx, msg):
msg = 'Please enter ' + nth(msg.word_count) + ' word'
ui.display.clear()
ui.header('Recovery device', ui.ICON_RECOVERY, ui.BG, ui.LIGHT_GREEN)
ui.display.text(10, 74, msg, ui.BOLD, ui.FG, ui.BG)
ui.display.text(10, 104, 'of your mnemonic.', ui.BOLD, ui.FG, ui.BG)
# TODO