Current File : //usr/lib/python3/dist-packages/lazr/uri/__pycache__/_uri.cpython-312.pyc |
�
�^K �
�$ � d Z eZg d�ZddlZ e i dd�dd�dd �d
d�dd
�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd �d!d"�d#d$�i d%d&�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2�d3d2�d4d5�d6d7�d8d9�d:d;�d<d=�d>d=�d?d@�dAd@�dBdC��d@ddDdEdDdDdFdDdG��ZdHZ dIZ
dJZdKZdLe
�dMe�dNe�dO�Z
dPZdQZdRZdSez ZdTZdUe
�e�dVe�dVe�dVe�dW�
ZdXe
�e�dVe�dVe�dVe�dW�
ZdYZdZZe �d[e�d\e�d]e�d^�Ze�d\e�d]e�d^�Z ej2 eej4 � Z ej2 eej4 � Zd_� Zd`� Zda� Z G db� dce � Z! G dd� de� Z"dfdgdhiz Z# ej2 e#ej4 ejH z � Z% ej2 di� Z&dj� Z'y# e$ r eZY ��~w xY w)kz/Functions for working with generic syntax URIs.)�URI�InvalidURIError�find_uris_in_text�possible_uri_re�merge�remove_dot_segments� N�acap�674�dav�80�dict�2628�dns�53�ftp�21�go�1096�gopher�70�h323�1720�http�https�443�imap�143�ipp�631z iris.beep�702�ldap�389�mtqp�1038�mupdate�3905�nfs�2049�nntp�119�pop�110�rtsp�554�sip�5060�sips�5061�snmp�161z soap.beep�605z
soap.beeps�telnet�23�tftp�69�tip�3372�vemmi�575zxmlrpc.beep�602zxmlrpc.beepszz39.50r�210zz39.50s�prospero�1525�22�6667�3690)�wais�bzr+http�bzr+ssh�irc�sftp�ssh�svn�svn+sshz(?P<scheme>[a-z][-a-z0-9+.]*)z9(?P<userinfo>(?:[-a-z0-9._~!$&\'()*+,;=:]|%[0-9a-f]{2})*)zs(?P<host>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|(?:[-a-z0-9._~!$&\'()*+,;=]|%[0-9a-f]{2})*|\[[0-9a-z:.]+\])z(?P<port>[0-9]*)z(?P<authority>(?:z@)?z(?::z)?)z2(?:/(?:[-a-z0-9._~!$&\'()*+,;=:@]|%[0-9a-f]{2})*)*z](?:[-a-z0-9._~!$&\'()*+,;=@]|%[0-9a-f]{2})+(?:/(?:[-a-z0-9._~!$&\'()*+,;=:@]|%[0-9a-f]{2})*)*z^(?:[-a-z0-9._~!$&\'()*+,;=:@]|%[0-9a-f]{2})+(?:/(?:[-a-z0-9._~!$&\'()*+,;=:@]|%[0-9a-f]{2})*)*z/(?:%s)?� z(?P<hierpart>//�|�)z(?P<relativepart>//z=(?P<query>(?:[-a-z0-9._~!$&\'()*+,;=:@/?\[\]]|%[0-9a-f]{2})*)z<(?P<fragment>(?:[-a-z0-9._~!$&\'()*+,;=:@/?]|%[0-9a-f]{2})*)�:z(?:\?z)?(?:#z)?$c �R � |r
| dk( rd|z S | j d� }| d|dz |z S )a/ Merge two URI path components into a single path component.
Follows rules specified in Section 5.2.3 of RFC 3986.
The algorithm in the RFC treats the empty basepath edge case
differently for URIs with and without an authority section, which
is why the third argument is necessary.
rM �/N� )�rfind)�basepath�relpath�
has_authority�slashs �//usr/lib/python3/dist-packages/lazr/uri/_uri.pyr r � s; � � ��R���W�}���N�N�3��E��H�U�1�W���'�'� c � � g }| r�| j d� r| dd } n�| j d� r| dd } n�| j d� s| dk( r d| dd z } n�| j d � s| d
k( rd| dd z } t |� dkD ri|d
= ne| dv rd} n^| j d� r| j dd� }n| j d� }|dk rt | � }|j | d| � | |d } | r��dj |� S )zqRemove '.' and '..' segments from a URI path.
Follows the rules specified in Section 5.2.4 of RFC 3986.
z../� Nz./� z/./z/.rR z/../z/..� r ���)�.z..rM rS )�
startswith�len�find�append�join)�path�outputrX s rY r r � s � �
�F�
��?�?�5�!����8�D�
�_�_�T�
"����8�D�
�_�_�U�
#�t�t�|���a�b��>�D�
�_�_�V�
$���
���a�b��>�D��6�{�Q���2�J�
�[�
��D����s�#�� � �#�q�)��� � �#����q�y��D� ���M�M�$�v��,�'����<�D�+ �, �7�7�6�?�rZ c � � | j d� }d}t |� D ]J \ }}|dk( r� t |dd d� }t |� |v rt |� |dd z ||<