| Server IP : 104.21.4.30 / Your IP : 104.23.197.229 Web Server : Apache System : Linux keen-cori.18-142-40-148.plesk.page 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64 User : simottodesign.com_2tntp341vs7 ( 10011) PHP Version : 8.3.31 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/serial/urlhandler/__pycache__/ |
Upload File : |
U
��WW� � @ s\ zd dl Z W n ek
r, d dlmZ Y nX d dlZdd� ZedkrXe�d�Ze e� dS )� Nc
C s� t �| �}|jdkr&t�d�|j���d}z@t �|jd��� D ](\}}|dkrX|d }q>t d�|���q>W n2 t k
r� } zt�d�|���W 5 d }~X Y nX t
t|�s�t d
�|���tt|�}t|tj
�s�t d�|���d�|j|jg�|fS )
z(extract host and port from an URL stringZaltzmexpected a string in the form "alt://port[?option[=value][&option[=value]]]": not starting with alt:// ({!r})�SerialT�classr zunknown option: {!r}zRexpected a string in the form "alt://port[?option[=value][&option[=value]]]": {!r}Nzunknown class: {!r}z'class {!r} is not an instance of Serial� )�urlparseZurlsplitZscheme�serialZSerialException�formatZparse_qsZquery�items�
ValueError�hasattr�getattr�
issubclassr �joinZnetloc�path)Zurl�parts�
class_nameZoption�values�e�cls� r �@/usr/lib/python3/dist-packages/serial/urlhandler/protocol_alt.py�serial_class_for_url s2
��
��
r �__main__z&alt:///dev/ttyS0?class=PosixPollSerial)
r �ImportErrorZurllib.parse�parser r �__name__Zserial_for_url�s�printr r r r �<module> s