https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/serial/urlhandler/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/serial/urlhandler/__pycache__/protocol_hwgrep.cpython-310.pyc
o

��^W�@stddlmZddlZddlZzeWneyeZYnwGdd�dej�Zedkr8ed�Z	de	_
ee	�dSdS)�)�absolute_importNc@s*eZdZdZejjjdd��Zdd�ZdS)�SerialzOJust inherit the native Serial port implementation and patch the port property.cCsBt|t�r|�d�rtjj�||�|��dStjj�||�dS)z%translate port name before storing it�	hwgrep://N)�
isinstance�
basestring�
startswith�serialr�port�__set__�from_url)�self�value�r�C/usr/lib/python3/dist-packages/serial/urlhandler/protocol_hwgrep.pyr	&szSerial.portc
	Cs|���d�r
|dd�}d}d}|�d�}|�d�}|D]6}d|vr,|�dd�\}}n|}d}|d	krFt|�d}|dkrEtd
�|���q|dkrMd}qtd
�|���ttj	j
�|��D]'\}	}
}|rzzt�|	�}Wn
tj
yuYq]w|��|r�|d8}q]|	St�
d�|���)z(extract host and port from an URL stringr�	NrF�&�=��nz9option "n" expects a positive integer larger than 1: {!r}�	skip_busyTzunknown option: {!r}z#no ports found matching regexp {!r})�lowerr�split�pop�int�
ValueError�format�sortedr�tools�
list_ports�grepr�SerialException�close)
r�urlr�	test_open�args�regexp�arg�optionr
r	�desc�hwid�srrrr.s@

��zSerial.from_urlN)	�__name__�
__module__�__qualname__�__doc__rrr	�setterrrrrrr"s

r�__main__zhwgrep://ttyS0)�
__future__rr�serial.tools.list_portsr�	NameError�strrr+r*r	�printrrrr�<module>s�6�

https://t.me/RX1948 - 2025