3
X                 @   s  d Z ddlZddlZddlZddlmZ ejj Zedd dkrRddl	m
Z
 nHedd dkrrddlm
Z
 n(ed	krd$ddZ
nedd dkrd%ddZ
 nedd dksedd dkrd&ddZ
nedd dkrd'ddZ
nedd dkrd(ddZ
nedd dkr*d)ddZ
npedd dkrHd*ddZ
nRedd dkrfd+ddZ
n4ddlZejjd jejejej ed!jejed"krx,ee
 D ]\ZZZed#jeee qW dS ),a  The ``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_common   linux)comports   darwincygwinFc             C   s,   t j d}| r|jtj| dd |D S )Nz
/dev/ttyS*c             S   s   g | ]}t j|qS  )r   ListPortInfo).0dr	   r	   ?/usr/lib/python3/dist-packages/serial/tools/list_ports_posix.py
<listcomp>)   s    zcomports.<locals>.<listcomp>)globextendr   
list_links)include_linksdevicesr	   r	   r   r   %   s    
r      Zopenbsdc             C   s,   t j d}| r|jtj| dd |D S )Nz	/dev/cua*c             S   s   g | ]}t j|qS r	   )r   r
   )r   r   r	   r	   r   r   0   s    zcomports.<locals>.<listcomp>)r   r   r   r   )r   r   r	   r	   r   r   ,   s    
   ZbsdZfreebsdc             C   s,   t j d}| r|jtj| dd |D S )Nz/dev/cua*[!.init][!.lock]c             S   s   g | ]}t j|qS r	   )r   r
   )r   r   r	   r	   r   r   7   s    zcomports.<locals>.<listcomp>)r   r   r   r   )r   r   r	   r	   r   r   3   s    
Znetbsdc             C   s,   t j d}| r|jtj| dd |D S )z8scan for available ports. return a list of device names.z	/dev/dty*c             S   s   g | ]}t j|qS r	   )r   r
   )r   r   r	   r	   r   r   ?   s    zcomports.<locals>.<listcomp>)r   r   r   r   )r   r   r	   r	   r   r   :   s    
   irixc             C   s,   t j d}| r|jtj| dd |D S )z8scan for available ports. return a list of device names.z
/dev/ttyf*c             S   s   g | ]}t j|qS r	   )r   r
   )r   r   r	   r	   r   r   G   s    zcomports.<locals>.<listcomp>)r   r   r   r   )r   r   r	   r	   r   r   B   s    
   Zhpc             C   s,   t j d}| r|jtj| dd |D S )z8scan for available ports. return a list of device names.z/dev/tty*p0c             S   s   g | ]}t j|qS r	   )r   r
   )r   r   r	   r	   r   r   O   s    zcomports.<locals>.<listcomp>)r   r   r   r   )r   r   r	   r	   r   r   J   s    
sunosc             C   s,   t j d}| r|jtj| dd |D S )z8scan for available ports. return a list of device names.z
/dev/tty*cc             S   s   g | ]}t j|qS r	   )r   r
   )r   r   r	   r	   r   r   W   s    zcomports.<locals>.<listcomp>)r   r   r   r   )r   r   r	   r	   r   r   R   s    
aixc             C   s,   t j d}| r|jtj| dd |D S )z8scan for available ports. return a list of device names.z	/dev/tty*c             S   s   g | ]}t j|qS r	   )r   r
   )r   r   r	   r	   r   r   _   s    zcomports.<locals>.<listcomp>)r   r   r   r   )r   r   r	   r	   r   r   Z   s    
a4  don'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{}: {} [{}])F)F)F)F)F)F)F)F)__doc__r   sysosZserial.toolsr   platformlowerZplatZserial.tools.list_ports_linuxr   Zserial.tools.list_ports_osxserialstderrwriteformatnameVERSIONImportError__name__sortedZportZdescZhwidprintr	   r	   r	   r   <module>   s@   
 	
