Add some informative comments
This commit is contained in:
parent
0c80ca8457
commit
2ad009bb9d
|
@ -43,10 +43,14 @@ class TrezorCompatibleWallet(BIP44_Wallet):
|
||||||
self.storage.put('session_timeout', seconds)
|
self.storage.put('session_timeout', seconds)
|
||||||
|
|
||||||
def disconnected(self):
|
def disconnected(self):
|
||||||
|
'''A device paired with the wallet was diconnected. Note this is
|
||||||
|
called in the context of the Plugins thread.'''
|
||||||
self.print_error("disconnected")
|
self.print_error("disconnected")
|
||||||
self.handler.watching_only_changed()
|
self.handler.watching_only_changed()
|
||||||
|
|
||||||
def connected(self):
|
def connected(self):
|
||||||
|
'''A device paired with the wallet was (re-)connected. Note this
|
||||||
|
is called in the context of the Plugins thread.'''
|
||||||
self.print_error("connected")
|
self.print_error("connected")
|
||||||
self.handler.watching_only_changed()
|
self.handler.watching_only_changed()
|
||||||
|
|
||||||
|
@ -55,6 +59,8 @@ class TrezorCompatibleWallet(BIP44_Wallet):
|
||||||
self.handler.watching_only_changed()
|
self.handler.watching_only_changed()
|
||||||
|
|
||||||
def timeout(self):
|
def timeout(self):
|
||||||
|
'''Informs the wallet it timed out. Note this is called from
|
||||||
|
the Plugins thread.'''
|
||||||
self.print_error("timed out")
|
self.print_error("timed out")
|
||||||
|
|
||||||
def get_action(self):
|
def get_action(self):
|
||||||
|
@ -176,6 +182,7 @@ class TrezorCompatiblePlugin(BasePlugin, ThreadJob):
|
||||||
return [self] if self.libraries_available else []
|
return [self] if self.libraries_available else []
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
'''Runs in the context of the Plugins thread.'''
|
||||||
now = time.time()
|
now = time.time()
|
||||||
if now > self.last_scan + 1:
|
if now > self.last_scan + 1:
|
||||||
self.last_scan = now
|
self.last_scan = now
|
||||||
|
@ -190,6 +197,7 @@ class TrezorCompatiblePlugin(BasePlugin, ThreadJob):
|
||||||
wallet.timeout()
|
wallet.timeout()
|
||||||
|
|
||||||
def scan_devices(self):
|
def scan_devices(self):
|
||||||
|
'''Scan devices. Runs in the context of the Plugins thread.'''
|
||||||
paths = self.HidTransport.enumerate()
|
paths = self.HidTransport.enumerate()
|
||||||
connected = set([c for c in self.clients if c.path in paths])
|
connected = set([c for c in self.clients if c.path in paths])
|
||||||
disconnected = self.clients - connected
|
disconnected = self.clients - connected
|
||||||
|
|
Loading…
Reference in New Issue