use click in trezorctl

This commit is contained in:
Pavol Rusnak 2017-07-03 17:45:56 +02:00
parent 0ee1667c6f
commit b335d30b8d
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
6 changed files with 573 additions and 547 deletions

View File

@ -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

View File

@ -30,6 +30,7 @@ install:
script: script:
- python setup.py install - python setup.py install
- flake8 - flake8
- flake8 trezorctl
- tox - tox
notifications: notifications:

View File

@ -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

View File

@ -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

930
trezorctl

File diff suppressed because it is too large Load Diff

View File

@ -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]: