ó ˆäVNc@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') availableccsnxgtƒD]\\}}}tj||tjƒsUtj||ƒsUtj||ƒr |||fVq q WdS(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(tcomportstretsearchtI(tregexptporttdescthwid((s;/usr/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( RtparsertoptionstargsthitstiteratorRR R ((s;/usr/lib/python2.7/site-packages/serial/tools/list_ports.pytmain.sJ       t__main__( t__doc__tsystosRtnametserial.tools.list_ports_windowstserial.tools.list_ports_posixt ImportErrorR R%t__name__(((s;/usr/lib/python2.7/site-packages/serial/tools/list_ports.pyts$    4