mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 12:00:59 +00:00
use click in trezorctl
This commit is contained in:
parent
0ee1667c6f
commit
b335d30b8d
5
.flake8
5
.flake8
@ -1,4 +1,7 @@
|
|||||||
[flake8]
|
[flake8]
|
||||||
|
filename =
|
||||||
|
*.py,
|
||||||
|
trezorctl
|
||||||
exclude =
|
exclude =
|
||||||
.tox/,
|
.tox/,
|
||||||
build/,
|
build/,
|
||||||
@ -11,6 +14,8 @@ ignore =
|
|||||||
F841,
|
F841,
|
||||||
# F401: module imported but unused
|
# F401: module imported but unused
|
||||||
F401,
|
F401,
|
||||||
|
# E241: multiple spaces after ':'
|
||||||
|
E241,
|
||||||
# E402: module level import not at top of file
|
# E402: module level import not at top of file
|
||||||
E402,
|
E402,
|
||||||
# E501: line too long
|
# E501: line too long
|
||||||
|
@ -30,6 +30,7 @@ install:
|
|||||||
script:
|
script:
|
||||||
- python setup.py install
|
- python setup.py install
|
||||||
- flake8
|
- flake8
|
||||||
|
- flake8 trezorctl
|
||||||
- tox
|
- tox
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
|
@ -3,3 +3,4 @@ protobuf>=3.1.0
|
|||||||
mnemonic>=0.17
|
mnemonic>=0.17
|
||||||
hidapi>=0.7.99.post20
|
hidapi>=0.7.99.post20
|
||||||
requests>=2.4.0
|
requests>=2.4.0
|
||||||
|
click>=6.2
|
||||||
|
1
setup.py
1
setup.py
@ -7,6 +7,7 @@ install_requires = [
|
|||||||
'mnemonic>=0.17',
|
'mnemonic>=0.17',
|
||||||
'setuptools>=19.0',
|
'setuptools>=19.0',
|
||||||
'requests>=2.4.0',
|
'requests>=2.4.0',
|
||||||
|
'click>=6.2'
|
||||||
]
|
]
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
@ -26,6 +26,8 @@ from .transport import TransportV2
|
|||||||
class UdpTransport(TransportV2):
|
class UdpTransport(TransportV2):
|
||||||
|
|
||||||
def __init__(self, device, *args, **kwargs):
|
def __init__(self, device, *args, **kwargs):
|
||||||
|
if device is None:
|
||||||
|
device = ''
|
||||||
device = device.split(':')
|
device = device.split(':')
|
||||||
if len(device) < 2:
|
if len(device) < 2:
|
||||||
if not device[0]:
|
if not device[0]:
|
||||||
|
Loading…
Reference in New Issue
Block a user