Fixed TREZOR plugin to work with python-trezor>=0.7.0 (to be released).

This commit is contained in:
slush0 2016-06-27 17:16:55 +02:00
parent 5bcadd6651
commit fdb810ba62
2 changed files with 7 additions and 4 deletions

View File

@ -106,15 +106,19 @@ class TrezorCompatiblePlugin(HW_PluginBase):
pair = [device.path, None]
try:
return self.HidTransport(pair)
from trezorlib.transport_hid import HidTransport
return HidTransport(pair)
except BaseException as e:
raise
self.print_error("cannot connect at", device.path, str(e))
return None
def _try_bridge(self, device):
self.print_error("Trying to connect over Trezor Bridge...")
try:
return self.BridgeTransport({'path': hexlify(device.path)})
from trezorlib.transport_bridge import BridgeTransport
return BridgeTransport({'path': hexlify(device.path)})
except BaseException as e:
self.print_error("cannot connect to bridge", str(e))
return None

View File

@ -15,8 +15,7 @@ class TrezorPlugin(TrezorCompatiblePlugin):
from .client import TrezorClient as client_class
import trezorlib.ckd_public as ckd_public
from trezorlib.client import types
from trezorlib.transport_hid import HidTransport, DEVICE_IDS
from trezorlib.transport_bridge import BridgeTransport
from trezorlib.transport_hid import DEVICE_IDS
libraries_available = True
except ImportError:
libraries_available = False