dhylands / usb-ser-mon

Auto connect to USB Serial devices.
MIT License
48 stars 29 forks source link

Fixed deprecation warnings. #5

Closed stawiski closed 4 years ago

stawiski commented 4 years ago

I was getting some warnings in the output:

test.py:71: DeprecationWarning: Will be removed in 1.0. Access properties with Device.properties.
  devs.append([device['ID_VENDOR_ID'], device['ID_MODEL_ID'],
test.py:56: DeprecationWarning: Will be removed in 1.0. Access properties with Device.properties.
  extra_items.append("vendor '%s'" % device['ID_VENDOR'])
test.py:58: DeprecationWarning: Will be removed in 1.0. Access properties with Device.properties.
  extra_items.append("serial '%s'" % device['ID_SERIAL_SHORT'])

This PR fixes that.

dhylands commented 4 years ago

FYI: I have a slightly different version of find_port.py here: https://github.com/dhylands/dotfiles/blob/master/bin/find_port.py which is more portable since it doesn't rely on usbdev. It uses python's port enumeration functions.