From e7cb1d474a49e060629ec08df599cd3dd4fe5ab1 Mon Sep 17 00:00:00 2001 From: Timothy Date: Tue, 26 Aug 2014 14:06:19 +0000 Subject: [PATCH] Document transport_hid class --- docs/transport_hid.rst | 2 +- trezorlib/transport_hid.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/transport_hid.rst b/docs/transport_hid.rst index b60c1a90e..02b1ea419 100644 --- a/docs/transport_hid.rst +++ b/docs/transport_hid.rst @@ -10,6 +10,6 @@ To get a list of TREZORs that are currently plugged into our computer, we use th We can now interact with our TREZORs by creating a :doc:`TrezorClient ` object. -.. automodule:: trezorlib.transport_hid +.. autoclass:: trezorlib.transport_hid.HidTransport :members: :undoc-members: \ No newline at end of file diff --git a/trezorlib/transport_hid.py b/trezorlib/transport_hid.py index 8db11a6e9..114679cbf 100644 --- a/trezorlib/transport_hid.py +++ b/trezorlib/transport_hid.py @@ -54,6 +54,9 @@ class HidTransport(Transport): @classmethod def enumerate(cls): + """ + Return a list of available TREZOR devices. + """ devices = {} for d in hid.enumerate(0, 0): vendor_id = d['vendor_id'] @@ -74,7 +77,9 @@ class HidTransport(Transport): return devices.values() def is_connected(self): - # Check if the device is still connected + """ + Check if the device is still connected. + """ for d in hid.enumerate(0, 0): if d['path'] == self.device: return True