tbird20d / grabserial

Grabserial - python-based serial dump and timing program - good for embedded Linux development
GNU General Public License v2.0
195 stars 77 forks source link

Check device against list_ports.comports() #1

Closed yegorich closed 10 years ago

yegorich commented 10 years ago

COM ports in Windows are not files and cannot be handled as Linux devices to check their existence. Use list_ports.comports() and check, if device exists against available devices.

Signed-off-by: Yegor Yefremov yegorslists@googlemail.com

tbird20d commented 10 years ago

Yegor,

My version of the python serial module does not have a 'tools' sub-module. I re-worked device_exists() to work with or without it. I am not set up to test this on Windows. Can you do that, and let me know if there are any problems with the solution I've just checked in.

Thanks for the new feature! -- Tim

yegorich commented 10 years ago

Tim,

I've tested your version on Windows (Python 2.7.6). Everything is working as expected.

Thanks for committing.

Yegor