Viewing File: /usr/lib/python2.7/site-packages/serial/tools/list_ports.pyo
ó
äVNc @ s° d Z d d l Z d d l Z d d l Z d d l Z e j d k rR d d l Tn2 e j d k rn d d l Tn e d e j f d Z d Z e
d k rŹ e n d S(
sA This 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˙˙˙˙Nt nt( t *t posixs; Sorry: no implementation for your platform ('%s') availablec c sn xg t D]\ \ } } } t j | | t j sU t j | | sU t j | | r
| | | f Vq
q
Wd S( 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( t comportst ret searcht I( t regexpt portt desct hwid( ( s; /usr/lib/python2.7/site-packages/serial/tools/list_ports.pyt grep# s <c C s d d l } | j d d d d } | j d d d d d
d t d d
| j d d d d d d d d d d | j d d d d d d d d d d | j \ } } d } | rt | d k rŮ | j d n d | d f GHt t | d } n t t } xW | D]O \ } } } d | f GH| j
d k r]d | f GHd | f GHn | d 7} qW| j
r| rd | f GHqd GHn d S(! Ni˙˙˙˙t usages %prog [options] [<regexp>]t descriptions9 Miniterm - A simple terminal program for the serial port.s --debugt helps6 print debug messages and tracebacks (development mode)t destt debugt defaultt actiont
store_trues -vs --verboses0 show more messages (can be given multiple times)t verbosei t counts -qs --quiets suppress all messagest store_constt consti s"