3 M]W@sdZddlZddlZddlZddlmZejjZedddkrRddl m Z n4edddkrrddl m Z ned krd d Z nedd d krdd Z nedddksedd dkrdd Z nedddkrdd Z nedddkrdd Z nedddkrdd Z nledddkr6dd Z nPedddkrRdd Z n4ddl Z ej jdjejeje jed jejed!krx,ee D]\ZZZed"jeeeqWdS)#aThe ``comports`` function is expected to return an iterable that yields tuples of 3 strings: port name, human readable description and a hardware ID. As currently no method is known to get the second two strings easily, they are currently just identical to the port name. N)list_ports_commonlinux)comportsdarwincygwincCstjd}dd|DS)Nz /dev/ttyS*cSsg|]}tj|qS)r ListPortInfo).0dr r &/usr/lib/python3.6/list_ports_posix.py 'szcomports..)glob)devicesr r r r%s rZopenbsdcCstjd}dd|DS)Nz /dev/cua*cSsg|]}tj|qSr )rr )r r r r r r,szcomports..)r)rr r r r*s ZbsdZfreebsdcCstjd}dd|DS)Nz/dev/cua*[!.init][!.lock]cSsg|]}tj|qSr )rr )r r r r r r1szcomports..)r)rr r r r/s ZnetbsdcCstjd}dd|DS)z8scan for available ports. return a list of device names.z /dev/dty*cSsg|]}tj|qSr )rr )r r r r r r7szcomports..)r)rr r r r4s irixcCstjd}dd|DS)z8scan for available ports. return a list of device names.z /dev/ttyf*cSsg|]}tj|qSr )rr )r r r r r r=szcomports..)r)rr r r r:s ZhpcCstjd}dd|DS)z8scan for available ports. return a list of device names.z /dev/tty*p0cSsg|]}tj|qSr )rr )r r r r r rCszcomports..)r)rr r r r@s sunoscCstjd}dd|DS)z8scan for available ports. return a list of device names.z /dev/tty*ccSsg|]}tj|qSr )rr )r r r r r rIszcomports..)r)rr r r rFs aixcCstjd}dd|DS)z8scan for available ports. return a list of device names.z /dev/tty*cSsg|]}tj|qSr )rr )r r r r r rOszcomports..)r)rr r r rLs a4don't know how to enumerate ttys on this system. ! I you know how the serial ports are named send this information to ! the author of this module: sys.platform = {!r} os.name = {!r} pySerial version = {} also add the naming scheme of the serial ports and with a bit luck you can get this module running... z;Sorry: no implementation for your platform ('{}') available__main__z {}: {} [{}])__doc__rsysosZ serial.toolsrplatformlowerZplatZserial.tools.list_ports_linuxrZserial.tools.list_ports_osxserialstderrwriteformatnameVERSION ImportError__name__sortedZportZdescZhwidprintr r r r s@