1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-10-13 11:29:11 +00:00
trezor-firmware/trezorlib
matejcik 69ef1f0acd transport: cleaner Transport list instantiation
Previously if an import of a dependent module (usb1, hid) failed, import
of the whole transport module would fail. This was resolved by catching
ImportErrors in the all_transports method.

This had two drawbacks:
- if something other than ImportError happened - e.g., libusb would
raise OSError if it couldn't find libusb.so - all_transports would crash
anyway
- at the same time, if a legitimately needed dependency
(typing_extensions) was missing, this would be masked by the ImportError
handling.

Instead, we unconditionally import the modules, and inside each one,
wrap dependencies in a try-except.

As an added benefit, it is now possible to disable a transport just by
setting SomeTransport.ENABLED = False
2018-11-26 15:30:42 +01:00
..
messages
qt
tests client: clean up constants 2018-11-26 15:30:42 +01:00
transport transport: cleaner Transport list instantiation 2018-11-26 15:30:42 +01:00
__init__.py
_ed25519.py
btc.py trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
cardano.py
ckd_public.py
client.py client: allow canceling pin/passphrase entry 2018-11-26 15:30:42 +01:00
coins.py tx_api: rework API, separate caching functionality to test support 2018-11-06 13:36:25 +01:00
cosi.py cosi: tests for new verify_m_of_n method 2018-10-12 12:58:49 +02:00
debuglink.py trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
device.py
ethereum.py trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
exceptions.py trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
firmware.py trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
lisk.py trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
log.py
mapping.py
misc.py trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
monero.py trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
nem.py
ontology.py trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
protobuf.py trezorlib: add some utility features 2018-11-06 13:36:25 +01:00
ripple.py trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
stellar.py
tezos.py
tools.py trezorlib: reentrant session handling 2018-11-12 12:22:32 +01:00
tx_api.py style: fix imports 2018-11-06 13:36:25 +01:00
ui.py client: allow canceling pin/passphrase entry 2018-11-26 15:30:42 +01:00