ó EIRTc@s°dZddlZddlZddlZddlZejdkrRddlTn2ejdkrnddlTnedejfƒ‚d„Zd„Z e d krŹe ƒndS( sAThis module will provide a function called comports that returns an iterable (generator or list) that will enumerate available com ports. Note that on some systems non-existent ports may be listed. Additionally a grep function is supplied that can be used to search for ports based on their descriptions or hardware ID. i˙˙˙˙Ntnt(t*tposixs;Sorry: no implementation for your platform ('%s') availableccsttj|tjƒ}xXtƒD]M\}}}|j|ƒs[|j|ƒs[|j|ƒr|||fVqqWdS(sÇ Search for ports using a regular expression. Port name, description and hardware ID are searched. The function returns an iterable that returns the same tuples as comport() would do. N(tretcompiletItcomportstsearch(tregexptrtporttdescthwid((sD/opt/freeware/lib/python2.7/site-packages/serial/tools/list_ports.pytgrep$s-c Cs•ddl}|jddddƒ}|jdddd d d td d ƒ|jddddd dd dd dƒ|jddddd dd dddƒ|jƒ\}}d}|rt|ƒdkrŮ|jdƒnd|dfGHtt|dƒƒ}ntt ƒƒ}xW|D]O\}}}d|fGH|j dkr]d|fGHd|fGHn|d7}qW|j r‘|r‰d|fGHq‘d GHndS(!Ni˙˙˙˙tusages%prog [options] []t descriptions9Miniterm - A simple terminal program for the serial port.s--debugthelps6print debug messages and tracebacks (development mode)tdesttdebugtdefaulttactiont store_trues-vs --verboses0show more messages (can be given multiple times)tverboseitcounts-qs--quietssuppress all messagest store_consttconstis"more than one regexp not supportedsFiltered list with regexp: %rs%-20ss desc: %ss hwid: %ss%d ports foundsno ports found( toptparset OptionParsert add_optiontFalset parse_argstlenterrortsortedR RR( RtparsertoptionstargsthitstiteratorR R R ((sD/opt/freeware/lib/python2.7/site-packages/serial/tools/list_ports.pytmain1sJ       t__main__( t__doc__tsystosRtnametserial.tools.list_ports_windowstserial.tools.list_ports_posixt ImportErrorR R't__name__(((sD/opt/freeware/lib/python2.7/site-packages/serial/tools/list_ports.pyts$    5