%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/lazr/uri/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/lazr/uri/__pycache__/_uri.cpython-312.pyc

�

�^K�
�$�dZeZgd�ZddlZ	eidd�dd�dd	�d
d�dd
�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd �d!d"�d#d$�id%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
dJZdKZdLe
�dMe�dNe�dO�Z
dPZdQZdRZdSezZdTZdUe
�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^�Zej2eej4�Zej2eej4�Zd_�Zd`�Zda�ZGdb�dce �Z!Gdd�de�Z"dfdgdhizZ#ej2e#ej4ejHz�Z%ej2di�Z&dj�Z'y#e$reZY��~wxYw)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�602zxmlrpc.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|zS|jd�}|d|dz|zS)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.pyrr�s;����R���W�}���N�N�3��E��H�U�1�W���'�'�c��g}|r�|jd�r|dd}n�|jd�r|dd}n�|jd�s|dk(r	d|ddz}n�|jd	�s|d
k(rd|ddz}t|�dkDri|d
=ne|dvrd}n^|jd�r|jdd�}n|jd�}|dkrt|�}|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/.rRz/../z/..�r���)�.z..rMrS)�
startswith�len�find�append�join)�path�outputrXs   rYrr�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�?�rZc��|jd�}d}t|�D]J\}}|dk(r�	t|ddd�}t	|�|vrt	|�|ddz||<�>d||ddfz||<�Ldj|�S#t$rY�iwxYw)	z�Return a version of 's' where no unreserved characters are encoded.

    Unreserved characters are defined in Section 2.3 of RFC 3986.

    Percent encoded sequences are normalised to upper case.
    �%zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~rNr]�z%%%02X%srM)�split�	enumerate�int�
ValueError�chrre)�string�result�
unreserved�index�item�chs      rY�normalise_unreservedrv�s����\�\�#�
�F�#�J�!��(�
8���t��A�:��	��T�"�1�X�r�"�B��r�7�j� ���G�d�1�2�h�.�F�5�M�&�"�d�1�2�h��7�F�5�M�
8��7�7�6�?���
�	��	�s�A=�=	B	�B	c��eZdZdZy)rzInvalid URIN)�__name__�
__module__�__qualname__�__doc__�rZrYrr�s��rZrc��eZdZdZ		dd�Zd�Zed��Zed��Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zy)rz�A class that represents a URI.

    This class can represent arbitrary URIs that conform to the
    generic syntax described in RFC 3986.
    Nc	���|�|�|�
|�|�|�|�|�	|�Jd��|��t|t�r	|jd�t
j
|�}	|	�t	d|z��|	jd�|_|	jd�|_	|	jd�|_
|	jd	�|_|	jd
�}
|	jd�}|�|
|_n|
dt|�zd|_|	jd
�|_|	jd�|_n\|�t	d��|�|�|�t	d��|�t	d��||_||_	||_
||_||_||_||_|j!�|jdvr%|jst	d|jz��yy#t$rt	d��wxYw)z�Create a URI instance.

        Can be called with either a string URI or the component parts
        of the URI as keyword arguments.

        In either case, all arguments are expected to be appropriately
        URI encoded.
        NzeURI() must be called with a single string argument or with URI components given as keyword arguments.�ASCIIz%URIs must consist of ASCII charactersz"%s" is not a valid URI�scheme�userinfo�host�port�hierpart�	authorityr]�query�fragmentzURIs must have a schemez*host must be given if userinfo or port arezURIs must have a path)
rrrrr6r�mmsr-rKrL�bzrrFrGz%s URIs must have a host name)�
isinstance�unicode�encode�UnicodeEncodeErrorr�uri_pat�match�groupr�r�r�r�rfrbr�r��
_normalise)�self�urir�r�r�r�rfr�r�r�r�r�s            rY�__init__zURI.__init__�s����F�N�x�7G�����$�,��
�(�"2�s�{�	?�
>�	?�C��?��#�w�'�A��J�J�w�'��M�M�#�&�E��}�%�&?�#�&E�F�F��+�+�h�/�D�K�!�K�K�
�3�D�M����F�+�D�I����F�+�D�I��{�{�:�.�H����K�0�I�� �$��	�%�Q�s�9�~�%5�%6�7��	����W�-�D�J�!�K�K�
�3�D�M��~�%�&?�@�@��|��!5��9I�%�@�B�B��|�%�&=�>�>� �D�K�$�D�M��D�I��D�I��D�I��D�J�$�D�M������K�K�9�
9��	�	�!�"A�"&�+�+�#.�/�
/��
9��K*�A�)�?�A�A�A�s�G�G c���|jj�|_|j�t|j�|_|j�(t|jj��|_|j
dk(rd|_n?|j
�3|j
tj|j�k(rd|_|j�|jdk(rd|_tt|j��|_|j�t|j�|_
|j�t|j�|_yy)z(Perform normalisation of URI components.NrMrR)r��lowerr�rvr�r��
_default_port�getrfrr�r��r�s rYr�zURI._normalises����k�k�'�'�)����=�=�$�0����?�D�M��9�9� �,�T�Y�Y�_�_�->�?�D�I��9�9��?��D�I�
�Y�Y�
"��y�y�M�-�-�d�k�k�:�:� ��	��9�9� �T�Y�Y�"�_��D�I�(�)<�T�Y�Y�)G�H��	��:�:�!�-�d�j�j�9�D�J��=�=�$�0����?�D�M�%rZc��|j�y|j}|j�|j�d|��}|j�|�d|j��}|S)zThe authority part of the URIN�@rP)r�r�r��r�r�s  rYr�z
URI.authority3sP���9�9����I�I�	��=�=�$�#'�=�=�)�<�I��9�9� �#,�d�i�i�8�I��rZc�X�|j}|�|jSd|�|j��S)z The hierarchical part of the URIz//)r�rfr�s  rY�	hier_partz
URI.hier_part?s3���N�N�	����9�9��� )�$�)�)�4�4rZc��|j�d|j��}|j�|d|jzz
}|j�|d|jzz
}|S)NrPz?%sz#%s)r�r�r�r�)r�r�s  rY�__str__zURI.__str__HsS�����d�n�n�5���:�:�!��5�4�:�:�%�%�C��=�=�$��5�4�=�=�(�(�C��
rZc�L�|jj�dt|��d�S)N�(rO)�	__class__rx�strr�s rY�__repr__zURI.__repr__Ps���>�>�2�2�C��I�>�>rZc�D�t||j�r�|j|jk(xrj|j|jk(xrO|j|jk(xr4|j
|j
k(xr|j|jk(StS�N)r�r�r�r�rfr�r��NotImplemented)r��others  rY�__eq__z
URI.__eq__Ss����e�T�^�^�,��K�K�5�<�<�/�4��N�N�e�o�o�5�4��I�I����+�4��J�J�%�+�+�-�4��M�M�U�^�^�3�	
5�"�!rZc�H�|j|�}|tk(rtS|Sr�)r�r�)r�r��equals   rY�__ne__z
URI.__ne__]s&�����E�"���N�"�!�!��9�rZc��t|j|j|j|j|j
f�Sr�)�hashr�r�rfr�r�r�s rY�__hash__zURI.__hash__ds6����K�K�������D�J�J��
�
�O�P�	PrZc	��|s|St|j|j|j|j|j
|j|j��}|j|�|jdi|��S)z;Replace one or more parts of the URI, returning the result.)r�r�r�r�rfr�r�r|)
r
r�r�r�r�rfr�r��updater�)r��parts�	basepartss   rY�replacezURI.replacehsi����K���;�;��]�]�����������*�*��]�]�$�	�	������t�~�~�*�	�*�*rZc���	|j|�S#t$rYnwxYwtj|�}|�td��t	|j
��}|j
d�}|�}|j
d�|d<|j
d�|d<|j
d�|d<t|j
d�d	t|�zd�|d
<|j
d�|d<n�|j
d�}|j
d�}|dk(r'|j|d
<|�||d<nm|j|d<n]|jd
�rt|�|d
<n8t|j||jdu��|d
<t|d
�|d
<||d<|j|d<|j|d<|j|d<|j
d�|d<|jdi|��S)z�Resolve the given URI reference relative to this URI.

        Uses the rules from Section 5.2 of RFC 3986 to resolve the new
        URI.
        NzInvalid relative reference)r�r�r�r�r��relativepartr]rfr�rMrR)rWr�r|)r�r�relative_ref_patr�r
r�r�rrbrfr�rarr�r�r�)r��	referencer�r�r�rfr�s       rY�resolvezURI.resolvews���	��>�>�)�,�,���	��	��!�&�&�y�1���=�!�">�?�?��D�K�K�(���K�K��,�	�� � %���J� 7�E�*��!�K�K��/�E�&�M�!�K�K��/�E�&�M�/����N�+�A�c�)�n�,<�,=�>�@�E�&�M�"�[�[��1�E�'�N��;�;�~�.�D��K�K��(�E��r�z� $�	�	��f�
��$�%*�E�'�N�%)�Z�Z�E�'�N��?�?�3�'�$7��$=�E�&�M�$)�$�)�)�T�8<�	�	��8M�%O�E�&�M�$7��f�
�$F�E�&�M�!&��g�� $�
�
�E�*�� �I�I�E�&�M� �I�I�E�&�M�!�K�K�
�3��j���t�~�~�&��&�&s��	�c�f�|jd�rJ�|j�j|�S)z�Append the given path to this URI.

        The path must not start with a slash, but a slash is added to
        base URI (before appending the path), in case it doesn't end
        with a slash.
        rR)ra�ensureSlashr�)r�rfs  rYrdz
URI.append�s0���?�?�3�'�'�'����!�)�)�$�/�/rZc�F�|j|jk7s|j|jk7ry|j|jk(ry|j}|jd�s|dz
}|j}|jd�s|dz
}|j	|�S)z9Returns True if the URI 'other' is contained by this one.FTrR)r�r�rf�endswithra)r�r�rU�	otherpaths    rY�containszURI.contains�s����K�K�5�<�<�'��N�N�e�o�o�-���9�9��
�
�"���9�9��� � ��%���O�H��J�J�	��!�!�#�&����I��#�#�H�-�-rZc��t|�dk(ry|jjd�}|jd�}|t|�d|k(S)z@Return True if the given domain name a parent of the URL's host.rTr`N)rbr�rk)r��domain�our_segments�domain_segmentss    rY�underDomainzURI.underDomain�sL���v�;�!����y�y���s�+�� �,�,�s�+���S��1�1�2�3��F�FrZc�z�|jjd�r|S|j|jdz��S)z:Return a URI with the path normalised to end with a slash.rR�rf)rfr�r�r�s rYr�zURI.ensureSlash�s2���9�9���c�"��K��<�<�T�Y�Y��_�<�5�5rZc��|jjd�r+|j|jjd���S|S)z>Return a URI with the path normalised to not end with a slash.rRr�)rfr�r��rstripr�s rY�
ensureNoSlashzURI.ensureNoSlash�s9���9�9���c�"��<�<�T�Y�Y�%5�%5�c�%:�<�;�;��KrZ)NNNNNNNN)rxryrzr{r�r��propertyr�r�r�r�r�r�r�r�r�rdr�r�r�r�r|rZrYrr�s����CG�<@�>/�B@�,�	��	��5��5��?�"��P�
+�0'�d0�
.�G�6�rZra�
\b
(?:about|gopher|http|https|sftp|news|ftp|mailto|file|irc|jabber|xmpp)
:
(?:
  (?:
    # "//" authority path-abempty
    //
    (?: # userinfo
      [%(unreserved)s:]*
      @
    )?
    (?: # host
      \d+\.\d+\.\d+\.\d+ |
      [%(unreserved)s]*
    )
    (?: # port
      : \d*
    )?
    (?: / [%(unreserved)s:@]* )*
  ) | (?:
    # path-absolute
    /
    (?: [%(unreserved)s:@]+
        (?: / [%(unreserved)s:@]* )* )?
  ) | (?:
    # path-rootless
    [%(unreserved)s@]
    [%(unreserved)s:@]*
    (?: / [%(unreserved)s:@]* )*
  )
)
(?: # query
  \?
  [%(unreserved)s:@/\?\[\]]*
)?
(?: # fragment
  \#
  [%(unreserved)s:@/\?]*
)?
rrz-a-zA-Z0-9._~%!$&'()*+,;=z
([,.?:);>]+)$c#��K�tj|�D]8}|j�}tj	d|�}	t|�}|���:y#t$rY�GwxYw�w)z8Scan a block of text for URIs, and yield the ones found.rMN)�possible_uri_pat�finditerr��uri_trailers_pat�subrr)�textr��
uri_stringr�s    rYrrAsg����!�*�*�4�0�	���[�[�]�
�&�)�)�"�j�9�
�	��j�/�C��	�	���	��	�s)�?A#�A�
A#�	A �A#�A � A#)(r{�type�
__metaclass__�__all__�rer��	NameErrorr�r��	scheme_re�userinfo_re�host_re�port_re�authority_re�path_abempty_re�path_noscheme_re�path_rootless_re�path_absolute_re�
path_empty_re�hier_part_re�relative_part_re�query_re�fragment_re�uri_re�relative_ref_re�compile�
IGNORECASEr�r�rrrv�	Exceptionrrr�VERBOSEr�r�rr|rZrY�<module>r�s`��"6��
���
���0�
�E�0�
�4�0��F�	0�

�4�0�
�4�
0�	�&�0�
�d�0��F�0��D�0��U�0��E�0�
�5�0���0��E�0� �F�!0�"�v�#0�$
�6�%0�&�E�'0�(
�5�)0�*�E�+0�,
�6�-0�.�F�/0�0�E�10�2��30�4�%�50�6
�d�70�8�D�90�:
�6�;0�<�U�=0�>�5�?0�@�E�A0�B�u�C0�D�u�E0�J��K0�L
��������_0�
�h
-�	�J��������'�#��H��J��J���!1�1���
��/�#3�5E����
�/�#3�5E����L��M���|�X�{�
4���h��-���"�*�*�V�R�]�]�
+���2�:�:�o�r�}�}�=��(��>�2�i��A�A�~	(�P�0�1�Q(2��T�2�:�:�o�r�}�}�r�z�z�/I�J���2�:�:�.�/����A���G��s�F�F�F

Zerion Mini Shell 1.0