1
0

Do not use side-effects of import to initialize hardware plugins

Call HidTransport in the context of a function
This commit is contained in:
ThomasV
2016-08-15 12:28:31 +02:00
parent d9021788fa
commit 55aa29917d
3 changed files with 46 additions and 18 deletions

View File

@@ -99,7 +99,7 @@ class TrezorCompatiblePlugin(HW_PluginBase):
pair = [device.path, None]
try:
return self.HidTransport(pair)
return self.hid_transport(pair)
except BaseException as e:
raise
self.print_error("cannot connect at", device.path, str(e))
@@ -109,7 +109,7 @@ class TrezorCompatiblePlugin(HW_PluginBase):
self.print_error("Trying to connect over Trezor Bridge...")
try:
return self.BridgeTransport({'path': hexlify(device.path)})
return self.bridge_transport({'path': hexlify(device.path)})
except BaseException as e:
self.print_error("cannot connect to bridge", str(e))
return None