mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
client: fix matrix recovery, use named enums, use isdigit(), ignore broken E721 test
This commit is contained in:
parent
81d5170c10
commit
b469519e26
4
.flake8
4
.flake8
@ -19,4 +19,6 @@ ignore =
|
||||
# E402: module level import not at top of file
|
||||
E402,
|
||||
# E501: line too long
|
||||
E501
|
||||
E501,
|
||||
# E721: do not compare types, use 'isinstance()'
|
||||
E721
|
||||
|
@ -254,18 +254,18 @@ class TextUIMixin(object):
|
||||
return proto.WordAck(word='\x08')
|
||||
|
||||
# ignore middle column if only 6 keys requested.
|
||||
if (isinstance(msg.type, types.WordRequestType_Matrix6) and character in ('2', '5', '8')):
|
||||
if msg.type == types.WordRequestType_Matrix6 and character in ('2', '5', '8'):
|
||||
continue
|
||||
|
||||
if (ord(character) >= ord('1') and ord(character) <= ord('9')):
|
||||
if character.isdigit():
|
||||
return proto.WordAck(word=character)
|
||||
|
||||
def callback_PinMatrixRequest(self, msg):
|
||||
if msg.type == 1:
|
||||
if msg.type == types.PinMatrixRequestType_Current:
|
||||
desc = 'current PIN'
|
||||
elif msg.type == 2:
|
||||
elif msg.type == types.PinMatrixRequestType_NewFirst:
|
||||
desc = 'new PIN'
|
||||
elif msg.type == 3:
|
||||
elif msg.type == types.PinMatrixRequestType_NewSecond:
|
||||
desc = 'new PIN again'
|
||||
else:
|
||||
desc = 'PIN'
|
||||
|
Loading…
Reference in New Issue
Block a user