mirror of
https://github.com/romanz/amodem.git
synced 2026-04-20 13:16:42 +08:00
trezor: Client should be a context manager
This commit is contained in:
@@ -39,7 +39,11 @@ class Client(object):
|
|||||||
log.debug('version : %s', '.'.join([str(v) for v in version]))
|
log.debug('version : %s', '.'.join([str(v) for v in version]))
|
||||||
log.debug('revision : %s', binascii.hexlify(f.revision))
|
log.debug('revision : %s', binascii.hexlify(f.revision))
|
||||||
|
|
||||||
def close(self):
|
def __enter__(self):
|
||||||
|
return self
|
||||||
|
|
||||||
|
def __exit__(self, *args):
|
||||||
|
log.info('disconnected from Trezor')
|
||||||
self.client.close()
|
self.client.close()
|
||||||
|
|
||||||
def get_public_key(self, label):
|
def get_public_key(self, label):
|
||||||
|
|||||||
Reference in New Issue
Block a user