python-trezor/tests/config.py

38 lines
1.2 KiB
Python
Raw Normal View History

2016-05-20 20:27:20 +00:00
from __future__ import print_function
2012-11-15 20:05:57 +00:00
import sys
sys.path = ['../',] + sys.path
2013-09-13 03:28:56 +00:00
from trezorlib.transport_pipe import PipeTransport
from trezorlib.transport_hid import HidTransport
from trezorlib.transport_socket import SocketTransportClient
#from trezorlib.transport_bridge import BridgeTransport
2012-11-15 20:05:57 +00:00
2014-02-08 16:53:32 +00:00
devices = HidTransport.enumerate()
if len(devices) > 0:
if devices[0][1] != None:
2016-05-05 01:16:17 +00:00
print('Using TREZOR')
2014-07-29 16:57:13 +00:00
TRANSPORT = HidTransport
2014-02-08 16:53:32 +00:00
TRANSPORT_ARGS = (devices[0],)
TRANSPORT_KWARGS = {'debug_link': False}
DEBUG_TRANSPORT = HidTransport
DEBUG_TRANSPORT_ARGS = (devices[0],)
DEBUG_TRANSPORT_KWARGS = {'debug_link': True}
else:
2016-05-05 01:16:17 +00:00
print('Using Raspberry Pi')
2014-02-08 16:53:32 +00:00
TRANSPORT = HidTransport
TRANSPORT_ARGS = (devices[0],)
TRANSPORT_KWARGS = {'debug_link': False}
DEBUG_TRANSPORT = SocketTransportClient
DEBUG_TRANSPORT_ARGS = ('trezor.bo:2000',)
DEBUG_TRANSPORT_KWARGS = {}
else:
2016-05-05 01:16:17 +00:00
print('Using Emulator')
2013-10-08 18:34:38 +00:00
TRANSPORT = PipeTransport
TRANSPORT_ARGS = ('/tmp/pipe.trezor', False)
2014-01-20 12:21:49 +00:00
TRANSPORT_KWARGS = {}
2013-10-08 18:34:38 +00:00
DEBUG_TRANSPORT = PipeTransport
DEBUG_TRANSPORT_ARGS = ('/tmp/pipe.trezor_debug', False)
2014-01-20 12:21:49 +00:00
DEBUG_TRANSPORT_KWARGS = {}