mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-09 15:00:58 +00:00
python: use TREZOR_PATH in get_default_client
This commit is contained in:
parent
ccacada37c
commit
4d7e3c8a23
@ -15,6 +15,7 @@
|
|||||||
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
|
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
import warnings
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
@ -73,13 +74,16 @@ def get_default_client(path=None, ui=None, **kwargs):
|
|||||||
|
|
||||||
Returns a TrezorClient instance with minimum fuss.
|
Returns a TrezorClient instance with minimum fuss.
|
||||||
|
|
||||||
If no path is specified, finds first connected Trezor. Otherwise performs
|
If path is specified, does a prefix-search for the specified device. Otherwise, uses
|
||||||
a prefix-search for the specified device. If no UI is supplied, instantiates
|
the value of TREZOR_PATH env variable, or finds first connected Trezor.
|
||||||
the default CLI UI.
|
If no UI is supplied, instantiates the default CLI UI.
|
||||||
"""
|
"""
|
||||||
from .transport import get_transport
|
from .transport import get_transport
|
||||||
from .ui import ClickUI
|
from .ui import ClickUI
|
||||||
|
|
||||||
|
if path is None:
|
||||||
|
path = os.getenv("TREZOR_PATH")
|
||||||
|
|
||||||
transport = get_transport(path, prefix_search=True)
|
transport = get_transport(path, prefix_search=True)
|
||||||
if ui is None:
|
if ui is None:
|
||||||
ui = ClickUI()
|
ui = ClickUI()
|
||||||
|
Loading…
Reference in New Issue
Block a user