From 5259146a0b585b640fda0f0eb44a7123bb84210d Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 10 Aug 2018 15:48:39 +0200 Subject: [PATCH] style: remove unused imports with autoflake --- trezorctl | 1 - trezorlib/client.py | 2 -- trezorlib/cosi.py | 1 - trezorlib/device.py | 2 -- trezorlib/firmware.py | 1 - trezorlib/log.py | 2 +- trezorlib/mapping.py | 1 - trezorlib/protocol_v1.py | 2 +- trezorlib/ripple.py | 2 -- .../tests/device_tests/test_msg_ethereum_signtx_eip155.py | 1 - trezorlib/tests/device_tests/test_msg_getaddress.py | 1 - trezorlib/tests/device_tests/test_msg_ripple_get_address.py | 3 +-- trezorlib/tests/device_tests/test_msg_stellar_get_address.py | 1 - .../tests/device_tests/test_msg_stellar_sign_transaction.py | 3 +-- trezorlib/tests/device_tests/test_protect_call.py | 1 - trezorlib/tests/support/ckd_public.py | 1 - trezorlib/transport/__init__.py | 2 +- trezorlib/transport/bridge.py | 1 - trezorlib/transport/hid.py | 1 - trezorlib/transport/udp.py | 2 -- trezorlib/transport/webusb.py | 1 - 21 files changed, 5 insertions(+), 27 deletions(-) diff --git a/trezorctl b/trezorctl index e4242a5e6..cb65ea328 100755 --- a/trezorctl +++ b/trezorctl @@ -26,7 +26,6 @@ import click import hashlib import io import json -import logging import os import sys diff --git a/trezorlib/client.py b/trezorlib/client.py index aad06ca73..7b1e14fdc 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -20,8 +20,6 @@ import os import sys import time import binascii -import hashlib -import unicodedata import getpass import warnings diff --git a/trezorlib/cosi.py b/trezorlib/cosi.py index 73ca36d3c..e2a95f363 100644 --- a/trezorlib/cosi.py +++ b/trezorlib/cosi.py @@ -14,7 +14,6 @@ # You should have received a copy of the License along with this library. # If not, see . -import sys from functools import reduce import binascii from typing import Iterable, Tuple diff --git a/trezorlib/device.py b/trezorlib/device.py index e8e3c1b5f..ad6ea5411 100644 --- a/trezorlib/device.py +++ b/trezorlib/device.py @@ -14,13 +14,11 @@ # You should have received a copy of the License along with this library. # If not, see . -import binascii import os import warnings from mnemonic import Mnemonic from . import messages as proto -from . import tools from .tools import expect, session from .transport import enumerate_devices, get_transport diff --git a/trezorlib/firmware.py b/trezorlib/firmware.py index 1072deae1..905c9bc88 100644 --- a/trezorlib/firmware.py +++ b/trezorlib/firmware.py @@ -1,6 +1,5 @@ import binascii import construct as c -import hashlib import pyblake2 from . import cosi diff --git a/trezorlib/log.py b/trezorlib/log.py index 69b809728..1bc4f192a 100644 --- a/trezorlib/log.py +++ b/trezorlib/log.py @@ -15,7 +15,7 @@ # If not, see . import logging -from typing import Set, Type, Optional +from typing import Optional from . import protobuf diff --git a/trezorlib/mapping.py b/trezorlib/mapping.py index 514465476..5d39ea8ca 100644 --- a/trezorlib/mapping.py +++ b/trezorlib/mapping.py @@ -15,7 +15,6 @@ # If not, see . from . import messages -from . import protobuf map_type_to_class = {} map_class_to_type = {} diff --git a/trezorlib/protocol_v1.py b/trezorlib/protocol_v1.py index 09167b9eb..592f4f230 100644 --- a/trezorlib/protocol_v1.py +++ b/trezorlib/protocol_v1.py @@ -19,7 +19,7 @@ from __future__ import absolute_import from io import BytesIO import logging import struct -from typing import Tuple, Type +from typing import Tuple from . import mapping from . import protobuf diff --git a/trezorlib/ripple.py b/trezorlib/ripple.py index d66227d21..3f18837f1 100644 --- a/trezorlib/ripple.py +++ b/trezorlib/ripple.py @@ -14,8 +14,6 @@ # You should have received a copy of the License along with this library. # If not, see . -import base64 -import struct from . import messages from .tools import expect diff --git a/trezorlib/tests/device_tests/test_msg_ethereum_signtx_eip155.py b/trezorlib/tests/device_tests/test_msg_ethereum_signtx_eip155.py index 9f4290d3f..c3942111b 100644 --- a/trezorlib/tests/device_tests/test_msg_ethereum_signtx_eip155.py +++ b/trezorlib/tests/device_tests/test_msg_ethereum_signtx_eip155.py @@ -18,7 +18,6 @@ from binascii import unhexlify, hexlify import pytest from .common import TrezorTest -from trezorlib import messages as proto from trezorlib import ethereum from trezorlib.tools import H_ diff --git a/trezorlib/tests/device_tests/test_msg_getaddress.py b/trezorlib/tests/device_tests/test_msg_getaddress.py index d1d4f245e..7ab8fbce0 100644 --- a/trezorlib/tests/device_tests/test_msg_getaddress.py +++ b/trezorlib/tests/device_tests/test_msg_getaddress.py @@ -14,7 +14,6 @@ # You should have received a copy of the License along with this library. # If not, see . -import pytest from .common import TrezorTest from ..support import ckd_public as bip32 diff --git a/trezorlib/tests/device_tests/test_msg_ripple_get_address.py b/trezorlib/tests/device_tests/test_msg_ripple_get_address.py index ed4d420a0..d4fabe014 100644 --- a/trezorlib/tests/device_tests/test_msg_ripple_get_address.py +++ b/trezorlib/tests/device_tests/test_msg_ripple_get_address.py @@ -18,9 +18,8 @@ import pytest from .common import TrezorTest from .conftest import TREZOR_VERSION -from binascii import hexlify from trezorlib.ripple import get_address -from trezorlib.tools import parse_path, CallException +from trezorlib.tools import parse_path from trezorlib import debuglink diff --git a/trezorlib/tests/device_tests/test_msg_stellar_get_address.py b/trezorlib/tests/device_tests/test_msg_stellar_get_address.py index 1a6385528..e8c16e065 100644 --- a/trezorlib/tests/device_tests/test_msg_stellar_get_address.py +++ b/trezorlib/tests/device_tests/test_msg_stellar_get_address.py @@ -18,7 +18,6 @@ import pytest from .common import TrezorTest from .conftest import TREZOR_VERSION -from binascii import hexlify from trezorlib import stellar from trezorlib import messages as proto from trezorlib.tools import parse_path, CallException diff --git a/trezorlib/tests/device_tests/test_msg_stellar_sign_transaction.py b/trezorlib/tests/device_tests/test_msg_stellar_sign_transaction.py index 12bc2830c..f6dc26f7b 100644 --- a/trezorlib/tests/device_tests/test_msg_stellar_sign_transaction.py +++ b/trezorlib/tests/device_tests/test_msg_stellar_sign_transaction.py @@ -48,8 +48,7 @@ from base64 import b64encode from .common import TrezorTest -from .conftest import TREZOR_VERSION -from binascii import hexlify, unhexlify +from binascii import hexlify from trezorlib import messages as proto from trezorlib import stellar from trezorlib.tools import parse_path diff --git a/trezorlib/tests/device_tests/test_protect_call.py b/trezorlib/tests/device_tests/test_protect_call.py index e1d73b2ab..891890f7d 100644 --- a/trezorlib/tests/device_tests/test_protect_call.py +++ b/trezorlib/tests/device_tests/test_protect_call.py @@ -20,7 +20,6 @@ import pytest from .common import TrezorTest from trezorlib import messages as proto from trezorlib.client import PinException -from trezorlib.tools import CallException # FIXME TODO Add passphrase tests diff --git a/trezorlib/tests/support/ckd_public.py b/trezorlib/tests/support/ckd_public.py index b49cb5e5f..4dc7a8956 100644 --- a/trezorlib/tests/support/ckd_public.py +++ b/trezorlib/tests/support/ckd_public.py @@ -17,7 +17,6 @@ import struct import hmac import hashlib -import sys import ecdsa from ecdsa.util import string_to_number, number_to_string diff --git a/trezorlib/transport/__init__.py b/trezorlib/transport/__init__.py index 4dbd36976..e26d561e3 100644 --- a/trezorlib/transport/__init__.py +++ b/trezorlib/transport/__init__.py @@ -17,7 +17,7 @@ import importlib import logging -from typing import Iterable, Type, List, Set +from typing import Iterable, Type LOG = logging.getLogger(__name__) diff --git a/trezorlib/transport/bridge.py b/trezorlib/transport/bridge.py index 15ded6b1d..b225acc03 100644 --- a/trezorlib/transport/bridge.py +++ b/trezorlib/transport/bridge.py @@ -21,7 +21,6 @@ from io import BytesIO import struct from .. import mapping -from .. import messages from .. import protobuf from . import Transport, TransportException diff --git a/trezorlib/transport/hid.py b/trezorlib/transport/hid.py index 8a20c4132..9e509e383 100644 --- a/trezorlib/transport/hid.py +++ b/trezorlib/transport/hid.py @@ -16,7 +16,6 @@ import time import hid -import os import sys from ..protocol_v1 import ProtocolV1 diff --git a/trezorlib/transport/udp.py b/trezorlib/transport/udp.py index 7943a2328..25b4f8110 100644 --- a/trezorlib/transport/udp.py +++ b/trezorlib/transport/udp.py @@ -14,11 +14,9 @@ # You should have received a copy of the License along with this library. # If not, see . -import os import socket from ..protocol_v1 import ProtocolV1 -from ..protocol_v2 import ProtocolV2 from . import Transport, TransportException diff --git a/trezorlib/transport/webusb.py b/trezorlib/transport/webusb.py index 23e81d5e9..6db2e2297 100644 --- a/trezorlib/transport/webusb.py +++ b/trezorlib/transport/webusb.py @@ -15,7 +15,6 @@ # If not, see . import time -import os import atexit import usb1 import sys