mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
style: isort & autopep
This commit is contained in:
parent
886d4f18f4
commit
ffff11a462
@ -327,9 +327,7 @@ def wipe_device(connect, bootloader):
|
||||
click.echo("Please switch your device to bootloader mode.")
|
||||
sys.exit(1)
|
||||
else:
|
||||
click.echo(
|
||||
"Wiping user data and firmware!"
|
||||
)
|
||||
click.echo("Wiping user data and firmware!")
|
||||
else:
|
||||
if client.features.bootloader_mode:
|
||||
click.echo(
|
||||
|
@ -15,15 +15,10 @@
|
||||
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
|
||||
|
||||
import functools
|
||||
import getpass
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import warnings
|
||||
|
||||
from mnemonic import Mnemonic
|
||||
|
||||
from . import (
|
||||
btc,
|
||||
cosi,
|
||||
|
@ -19,8 +19,8 @@ from mnemonic import Mnemonic
|
||||
|
||||
from . import messages as proto, tools
|
||||
from .client import TrezorClient
|
||||
from .tools import expect
|
||||
from .protobuf import format_message
|
||||
from .tools import expect
|
||||
|
||||
|
||||
class DebugLink:
|
||||
|
@ -17,12 +17,10 @@
|
||||
import os
|
||||
import warnings
|
||||
|
||||
from mnemonic import Mnemonic
|
||||
|
||||
from . import messages as proto
|
||||
from .exceptions import Cancelled
|
||||
from .tools import expect, session
|
||||
from .transport import enumerate_devices, get_transport
|
||||
from .exceptions import Cancelled
|
||||
|
||||
RECOVERY_BACK = "\x08" # backspace character, sent literally
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
import os
|
||||
|
||||
from trezorlib import coins, debuglink, device, tx_api
|
||||
from trezorlib.messages.PassphraseSourceType import HOST as PASSPHRASE_ON_HOST
|
||||
from trezorlib.debuglink import TrezorClientDebugLink
|
||||
from trezorlib.messages.PassphraseSourceType import HOST as PASSPHRASE_ON_HOST
|
||||
|
||||
from . import conftest
|
||||
|
||||
|
@ -19,10 +19,10 @@ import os
|
||||
|
||||
import pytest
|
||||
|
||||
from trezorlib import coins, log
|
||||
from trezorlib import coins, debuglink, log
|
||||
from trezorlib.debuglink import TrezorClientDebugLink
|
||||
from trezorlib.device import wipe as wipe_device
|
||||
from trezorlib.transport import enumerate_devices, get_transport
|
||||
from trezorlib import device, debuglink
|
||||
|
||||
TREZOR_VERSION = None
|
||||
|
||||
@ -55,7 +55,7 @@ def client():
|
||||
wirelink = get_device()
|
||||
client = TrezorClientDebugLink(wirelink)
|
||||
client.set_tx_api(coins.tx_api["Bitcoin"])
|
||||
device.wipe(client)
|
||||
wipe_device(client)
|
||||
client.transport.session_begin()
|
||||
|
||||
yield client
|
||||
|
@ -3,9 +3,9 @@ import os
|
||||
import click
|
||||
from mnemonic import Mnemonic
|
||||
|
||||
from .messages import WordRequestType, PinMatrixRequestType
|
||||
from . import device
|
||||
from .exceptions import Cancelled
|
||||
from .messages import PinMatrixRequestType, WordRequestType
|
||||
|
||||
PIN_MATRIX_DESCRIPTION = """
|
||||
Use the numeric keypad to describe number positions. The layout is:
|
||||
@ -110,7 +110,7 @@ try:
|
||||
key = msvcrt.getwch()
|
||||
if key == "\x03":
|
||||
raise KeyboardInterrupt
|
||||
if key in (0x00, 0xe0):
|
||||
if key in (0x00, 0xE0):
|
||||
# skip special keys: read the scancode and repeat
|
||||
msvcrt.getwch()
|
||||
continue
|
||||
@ -138,4 +138,3 @@ def matrix_words(type):
|
||||
return ch
|
||||
if type == WordRequestType.Matrix9 and ch in "123456789":
|
||||
return ch
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user