diff --git a/tools/encfs_aes_getpass.py b/tools/encfs_aes_getpass.py index 775b0b1c16..ef67b5529b 100755 --- a/tools/encfs_aes_getpass.py +++ b/tools/encfs_aes_getpass.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function ''' @@ -16,7 +16,7 @@ import hashlib import binascii from trezorlib.client import TrezorClient -from trezorlib.transport_hid import HidTransport +from trezorlib.device import TrezorDevice # Python2 vs Python3 try: @@ -26,11 +26,11 @@ except NameError: def wait_for_devices(): - devices = HidTransport.enumerate() + devices = TrezorDevice.enumerate() while not len(devices): sys.stderr.write("Please connect TREZOR to computer and press Enter...") input() - devices = HidTransport.enumerate() + devices = TrezorDevice.enumerate() return devices diff --git a/tools/helloworld.py b/tools/helloworld.py index 7f7a0a8c6f..9712a2b269 100755 --- a/tools/helloworld.py +++ b/tools/helloworld.py @@ -1,13 +1,13 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from trezorlib.client import TrezorClient -from trezorlib.transport_hid import HidTransport +from trezorlib.device import TrezorDevice def main(): - # List all connected TREZORs on USB - devices = HidTransport.enumerate() + # List all connected TREZORs on USB/UDP + devices = TrezorDevice.enumerate() # Check whether we found any if len(devices) == 0: diff --git a/tools/mnemonic_check.py b/tools/mnemonic_check.py index fe3fbba958..6c5c1fc554 100755 --- a/tools/mnemonic_check.py +++ b/tools/mnemonic_check.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import binascii import hashlib diff --git a/tools/rng_entropy_collector.py b/tools/rng_entropy_collector.py index 58c63559c7..2ae738a32c 100755 --- a/tools/rng_entropy_collector.py +++ b/tools/rng_entropy_collector.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # example usage: ./rng_entropy_collector.py stm32_rng_1.dat 1048576 # note: for reading large amounts of entropy, compile a firmware # that has DEBUG_RNG == 1 as that will disable the user button @@ -8,11 +8,11 @@ from __future__ import print_function import io import sys from trezorlib.client import TrezorClient -from trezorlib.transport_hid import HidTransport +from trezorlib.device import TrezorDevice def get_client(): - devices = HidTransport.enumerate() # list all connected TREZORs on USB + devices = TrezorDevice.enumerate() # list all connected TREZORs on USB if len(devices) == 0: # check whether we found any return None transport = devices[0] # use first connected device @@ -30,7 +30,7 @@ def main(): step = 1024 if arg2 >= 1024 else arg2 # trezor will only return 1KB at a time with io.open(arg1, 'wb') as f: - for i in xrange(0, arg2, step): + for i in range(0, arg2, step): entropy = client.get_entropy(step) f.write(entropy)