?????????? ????????? - ??????????????? - /usr/lib/python3.9/site-packages/serial/tools/__pycache__/list_ports.cpython-39.pyc
???????
a ��X � @ s� d Z ddlZddlZddlZejdkr4ddlmZ n(ejdkrLddlmZ ned� ej���d dd �Z d d� Zedkr|e� dS )aA 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. � N�nt)�comports�posixz;Sorry: no implementation for your platform ('{}') availableFc c sN t �| t j�}t|�D ]2}|\}}}|�|�sB|�|�sB|�|�r|V qdS )z� 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)�re�compile�Ir �search)�regexp� include_links�r�info�port�desc�hwid� r �;/usr/lib/python3.9/site-packages/serial/tools/list_ports.py�grep% s r c C sd dd l } | jdd�}|jdddd� |jdd d dd� |jd dd dd� |jdtdd� |jddd dd� |�� }d}|jr�|js�tj� d� |j�� tt|j|j d��}ntt|j d��}t|d�D ]j\}\}}}|jd u s�|j|k�r(tj� d� |�� |j�r(tj� d� |�� tj� d� |�� |d7 }q�|j�s`|�rTtj� d� |�� ntj� d� d S )Nr zSerial port enumeration)�descriptionr �?z%only show ports that match this regex)�nargs�helpz-vz --verbose� store_truezshow more messages)�actionr z-qz--quietzsuppress all messagesz-nzonly output the N-th entry)�typer z-sz--include-linksz1include entries that are symlinks to real devicesz Filtered list with regexp: {!r} )r � z{:20} z desc: {} z hwid: {} z{} ports found zno ports found )�argparse�ArgumentParser�add_argument�int� parse_argsr �quiet�sys�stderr�write�format�sortedr r r � enumerate�n�stdout�verbose) r �parser�args�hits�iteratorr'