← Back
Editing: list_ports.cpython-312.pyc
� ��^= � �� � d Z ddlmZ ddlZddlZddlZej dk( rddlmZ n7ej dk( rddl mZ n! e dj ej � � �dd�Zd � Z ed k( r e � yy)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. � )�absolute_importN�nt)�comports�posixz;Sorry: no implementation for your platform ('{}') availablec # �� K � t j | t j � }t |� D ]@ }|\ }}}|j |� s#|j |� s|j |� s�=|�� �B y�w)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�hwids �9/usr/lib/python3/dist-packages/serial/tools/list_ports.py�grepr '