walac/pyusb — pull request #80 by ecejeff (2014-12-03 17:30:07+00:00)
Title: Add port_numbers device property

Add port_numbers device property (not to be confused with existing port_number). This just wraps libusb_get_port_numbers(...) and presents the result as a tuple.

Usage: my application uses this function to find a USB device after it has re-enumerated as a bootloader with different VID and PID, but the same physical port location.

My first implementation used a string, but upon further reflection I determined that a tuple was a more natural representation, as the tuple can easily be converted to a string if necessary (and the reverse is a bit trickier).