ttrezor: simplify get_client - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 1427d962499ff1f8dca56b3474a1e0173b211524
DIR parent ed1001bf8b6bd311e4fd1796f9e06c808bac8e47
HTML Author: ThomasV <thomasv@gitorious>
Date: Sun, 28 Jun 2015 19:59:27 +0200
ttrezor: simplify get_client
Diffstat:
M plugins/trezor.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
---
DIR diff --git a/plugins/trezor.py b/plugins/trezor.py
t@@ -97,13 +97,10 @@ class Plugin(BasePlugin):
give_error('please install github.com/trezor/python-trezor')
if not self.client or self.client.bad:
- try:
- d = HidTransport.enumerate()[0]
- self.transport = HidTransport(d)
- except:
- import traceback
- traceback.print_exc(file=sys.stdout)
+ d = HidTransport.enumerate()
+ if not d:
give_error('Could not connect to your Trezor. Please verify the cable is connected and that no other app is using it.')
+ self.transport = HidTransport(d[0])
self.client = QtGuiTrezorClient(self.transport)
self.client.handler = self.handler
self.client.set_tx_api(self)