axi icon indicating copy to clipboard operation
axi copied to clipboard

Better port finding, Python 3 fixes, and util.draw cleanup

Open sgentle opened this issue 7 years ago • 0 comments

Hi! I've fixed a couple things in my fork that you might like.

I made the port finding use pyserial 3's .pid/.vid, and fall back to more robust string parsing for pyserial 2 that should match obscure cases like USB VID:PID=4d8:fd92 (for some reason my Mac does this). Note that this new pattern won't match strings without VID:PID=, but I think pyserial always provides that.

I also fixed an error I was getting because pyserial 3 expects strings to be encoded into bytes before writing them. With both of those fixes it's working well under python 2 and 3 on my Mac.

Lastly, I put a try/finally in util.draw so that it always turns the motors off and lifts the pen, even if interrupted with ctrl+c. Multiple calls to pen_up don't seem to do anything bad, so I figured it was a safe change.

sgentle avatar Mar 08 '18 11:03 sgentle