| Server IP : 138.197.176.125 / Your IP : 216.73.217.110 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /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