From bb78873e241a6abc148c1e74691bce0e74bcbecb Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 21 Jul 2014 19:41:43 +0200 Subject: [PATCH] don't use internal cmdtr module in trezor plugin --- plugins/trezor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/trezor.py b/plugins/trezor.py index 523f85074..7f9823e86 100644 --- a/plugins/trezor.py +++ b/plugins/trezor.py @@ -14,11 +14,11 @@ from lib.wallet import NewWallet try: - import cmdtr from trezorlib.client import types from trezorlib.client import proto, BaseClient, ProtocolMixin from trezorlib.qt.pinmatrix import PinMatrixWidget from trezorlib.transport import ConnectionError + from trezorlib.transport_hid import HidTransport TREZOR = True except ImportError: TREZOR = False @@ -117,7 +117,11 @@ class TrezorWallet(NewWallet): raise Exception('please install github.com/trezor/python-trezor') if not self.client or self.client.bad: - self.transport = cmdtr.get_transport('usb', '') + try: + d = HidTransport.enumerate()[0] + self.transport = HidTransport(d) + except: + raise Exception("Trezor not found") self.client = QtGuiTrezorClient(self.transport) self.client.set_tx_api(self) #self.client.clear_session()# TODO Doesn't work with firmware 1.1, returns proto.Failure