This repository has been archived by the owner on Jun 5, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 193
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…le, move common functions to superclass
… make it better ^_^
For UDP transport, it's useful to be able to specify a path that should be tried directly, without enumerating first.
first, try exact path second, try prefix search last, fail :) with reporting used path (for people like me who forget to unset TREZOR_PATH
that also respects TREZOR_PATH
posting this now to solicit comments. It's still necessary to update most tools to use the new API, and do the DeprecationWarning wrapper. |
@slush0 would you like to have a look? |
Since you're changing the transports API, could you also update |
also drop some python2 compatibility things
…ne if no trezor is found, because the IndexError should not be part of the traceback
@saleemrashid does this solve your problem? also added the promised |
this fixes issue #223 on Windows, where a device would be returned in two copies, only one of which works
LGTM |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The new feature:
trezorctl -p hid
will pick the first HID device, andtrezorctl -p bridge:w
will pick the first WebUSB device on bridge. It's still possible to specify a full path and that will be tried directly before prefix-searching (so it's possible to specify UDP addresses that are not the default one).There's also a refactor of transports.
While the prefix search for paths is desirable, the refactor is not necessary, I just took the opportunity to clean up a little.
The main thing is removing
device.py
because it's very much useless. The functionality is now moved to a pair of functions intrezorlib.transport
. This is an API change and will need to be fixed in users... which is why i'm sort of hesitant about it. OTOH, the original API doesn't make sense.I'll probably add a backwards compatibility wrapper that shouts DeprecationWarnings.
(it's also easy to write backwards compatible code:
)
Transports now have their own submodule, which seems cleaner but isn't really necessary either.