-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed Power test script to use LibUSB #6
base: master
Are you sure you want to change the base?
Conversation
def __init__(self, device: USBDevice) -> None: | ||
"""Construct power board from `USBDevice`.""" | ||
self.device = device | ||
self._configuration: Optional[usb.core.Endpoint] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would enjoy this being compatible with Python 3.5 - remove this line and type annotate via a comment on the next line (add # type: Optional[usb.core.Endpoint]
there)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly great, thanks!
Have we used this script to check some power boards?
My main comment is that it would be great to be compatible with Python 3.5.
|
||
This will: | ||
|
||
- hopefully not crash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a more useful description we can put here?
import usb.core | ||
import usb.util | ||
|
||
class USBDevice(NamedTuple): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great if we could make this compatible with Python 3.5 so those of us using Debian stable (or a derivative) can use these scripts.
USBDevice = NamedTuple('USBDevice', (
('serial', str),
('node', usb.core.Device),
('busnum', int),
('devnum', int),
))
No description provided.