Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tyler-Ward
Copy link
Member

No description provided.

def __init__(self, device: USBDevice) -> None:
"""Construct power board from `USBDevice`."""
self.device = device
self._configuration: Optional[usb.core.Endpoint]
Copy link
Member

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)

Copy link
Member

@PeterJCLaw PeterJCLaw left a 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
Copy link
Member

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):
Copy link
Member

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),
))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants