Your IP : 216.73.217.13


Current Path : /lib/python3/dist-packages/serial/urlhandler/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/serial/urlhandler/__pycache__/protocol_alt.cpython-38.pyc

U

��WW��@s\zddlZWn ek
r,ddlmZYnXddlZdd�ZedkrXe�d�Ze	e�dS)�Nc
Cs�t�|�}|jdkr&t�d�|j���d}z@t�|jd���D](\}}|dkrX|d}q>t	d�|���q>Wn2t	k
r�}zt�d�|���W5d	}~XYnXt
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�classrzunknown 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_urls2

��
��

r�__main__z&alt:///dev/ttyS0?class=PosixPollSerial)
r�ImportErrorZurllib.parse�parserr�__name__Zserial_for_url�s�printrrrr�<module>s