@@ -10,12 +10,26 @@ class TrezorPlugin(TrezorCompatiblePlugin):
1010 libraries_URL = 'https://github.com/trezor/python-trezor'
1111 minimum_firmware = (1 , 3 , 3 )
1212 keystore_class = TrezorKeyStore
13- try :
14- from .client import TrezorClient as client_class
15- import trezorlib .ckd_public as ckd_public
16- from trezorlib .client import types
17- from trezorlib .transport_hid import HidTransport , DEVICE_IDS
13+
14+ def __init__ (self , * args ):
15+ try :
16+ import client
17+ import trezorlib
18+ import trezorlib .ckd_public
19+ import trezorlib .transport_hid
20+ self .client_class = client .TrezorClient
21+ self .ckd_public = trezorlib .ckd_public
22+ self .types = trezorlib .client .types
23+ self .DEVICE_IDS = trezorlib .transport_hid .DEVICE_IDS
24+ self .libraries_available = True
25+ except ImportError :
26+ self .libraries_available = False
27+ TrezorCompatiblePlugin .__init__ (self , * args )
28+
29+ def hid_transport (self , pair ):
30+ from trezorlib .transport_hid import HidTransport
31+ return HidTransport (pair )
32+
33+ def bridge_transport (self , d ):
1834 from trezorlib .transport_bridge import BridgeTransport
19- libraries_available = True
20- except ImportError :
21- libraries_available = False
35+ return BridgeTransport (d )
0 commit comments