Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/serial/urlhandler/__pycache__/ |
Upload File : |
o ��^� � @ sj d dl mZ zd dlZW n ey d dlmZ Y nw d dlZdd� Zedkr3e� d�Z ee � dS dS )� )�absolute_importNc C s� t �| �}|jdkrt�d�|j���d}zt �|jd��� D ]\}}|dkr,|d }qt d�|���W n t yH } zt�d�|���d }~ww t t|�sUt d �|���tt|�}t|tj �sgt d�|���d�|j|jg�|fS ) z(extract host and port from an URL string�altzmexpected 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� )�urlparse�urlsplit�scheme�serial�SerialException�format�parse_qs�query�items� ValueError�hasattr�getattr� issubclassr �join�netloc�path)�url�parts� class_name�option�values�e�cls� r �@/usr/lib/python3/dist-packages/serial/urlhandler/protocol_alt.py�serial_class_for_url s4 � ���� r �__main__z&alt:///dev/ttyS0?class=PosixPollSerial)� __future__r r �ImportError�urllib.parse�parser r �__name__�serial_for_url�s�printr r r r �<module> s � �