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