python: use TREZOR_PATH in get_default_client

pull/785/head
matejcik 4 years ago committed by Pavol Rusnak
parent ccacada37c
commit 4d7e3c8a23
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -15,6 +15,7 @@
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
import logging
import os
import sys
import warnings
from types import SimpleNamespace
@ -73,13 +74,16 @@ def get_default_client(path=None, ui=None, **kwargs):
Returns a TrezorClient instance with minimum fuss.
If no path is specified, finds first connected Trezor. Otherwise performs
a prefix-search for the specified device. If no UI is supplied, instantiates
the default CLI UI.
If path is specified, does a prefix-search for the specified device. Otherwise, uses
the value of TREZOR_PATH env variable, or finds first connected Trezor.
If no UI is supplied, instantiates the default CLI UI.
"""
from .transport import get_transport
from .ui import ClickUI
if path is None:
path = os.getenv("TREZOR_PATH")
transport = get_transport(path, prefix_search=True)
if ui is None:
ui = ClickUI()

Loading…
Cancel
Save