%PDF- %PDF-
Direktori : /lib/python3/dist-packages/serial/urlhandler/__pycache__/ |
Current File : //lib/python3/dist-packages/serial/urlhandler/__pycache__/protocol_alt.cpython-312.pyc |
� ��^� � � � d dl mZ d dlZd dlZd� Zedk( r ej d� Z ee � yy# e$ r d dlmZ Y �5w xY w)� )�absolute_importNc � � t j | � }|j dk7 r.t j dj |j � � �d} t j |j d� j � D ]) \ }}|dk( r|d }�t dj |� � � t t |� st d j |� � �t t |� }t |t j � st dj |� � �dj |j |j g� |fS # t $ r)}t j dj |� � �d }~ww xY w) 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�clss �@/usr/lib/python3/dist-packages/serial/urlhandler/protocol_alt.py�serial_class_for_urlr! sW � ����c�"�E��|�|�u���$�$� .�.4�f�U�\�\�.B�D� D� �J� N�&�/�/����T�B�H�H�J� H�N�F�F��� �#�A�Y� � �!7�!>�!>�v�!F�G�G� H� �6�:�&��.�5�5�j�A�B�B� �&�*� %�C��c�6�=�=�)��B�I�I�*�U�V�V��G�G�U�\�\�5�:�:�.�/��5�5�� � N��$�$� C�CI�6�!�9�N� N��N�s �AE � E:�$E5�5E:�__main__z&alt:///dev/ttyS0?class=PosixPollSerial)� __future__r r �ImportError�urllib.parse�parser r! �__name__�serial_for_url�s�print� � r �<module>r- sZ ��&