Server IP : 23.254.227.96 / Your IP : 216.73.216.7 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.6/site-packages/serial/urlhandler/__pycache__/ |
Upload File : |
3 M�]W� � @ sZ yd dl Z W n ek r* d dljZ Y nX d dlZdd� ZedkrVejd�Ze e� dS )� Nc C s� t j| �}|jdkr&tjdj|j���d}yDx>t j|jd�j� D ](\}}|dkrZ|d }q@t dj|���q@W W n2 t k r� } ztjdj|���W Y d d }~X nX t t|�s�t d j|���tt|�}t|tj �s�t dj|���dj|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� )�urlparseZurlsplit�scheme�serialZSerialException�formatZparse_qsZquery�items� ValueError�hasattr�getattr� issubclassr �joinZnetloc�path)Zurl�parts� class_nameZoption�values�e�cls� r �"/usr/lib/python3.6/protocol_alt.py�serial_class_for_url s* r �__main__z&alt:///dev/ttyS0?class=PosixPollSerial) r �ImportErrorZurllib.parse�parser r �__name__Zserial_for_url�s�printr r r r �<module> s