HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/lib/python3/dist-packages/httplib2/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3/dist-packages/httplib2/__pycache__/iri2uri.cpython-311.pyc
�

Zճc9���dZdZdZgZdZdZddlZgd�Zd�Z	d	�Z
ed
kr(ddlZGd�dej
��Zej��dSdS)
zConverts an IRI to a URI.z!Joe Gregorio (joe@bitworking.org)zCopyright 2006, Joe Gregorioz1.0.0�MIT�N))�i��)i�i��)i�i�)i�i�)ii��)ii��)ii��)ii��)ii��)ii��)ii��)ii��)i	i��	)i
i��
)ii��)ii��)i
i��
)ii��)ii��)ii��c���|}t|��}tD]M\}}||krnA||kr:||kr4d�d�|�d��D����}n�N|S)N�c��g|]}d|z��S)z%%%2X�)�.0�os  �2/usr/lib/python3/dist-packages/httplib2/iri2uri.py�
<listcomp>zencode.<locals>.<listcomp>7s��E�E�E�a�g��k�E�E�E��utf-8)�ord�escape_range�join�encode)�c�retval�i�low�highs     rrr0s{��
�F��A���A�!���	��T��s�7�7��E���8�8��T�	�	��W�W�E�E�1�8�8�G�3D�3D�E�E�E�F�F�F��E���Mr
c�P�t|t��r�tj�|��\}}}}}|�d���d��}tj�|||||f��}d�d�|D����}|S)z�Convert an IRI to a URI. Note that IRIs must be
    passed in a unicode strings. That is, do not utf-8 encode
    the IRI before passing it into the function.�idnarrc�,�g|]}t|����Sr)r)r	rs  rrziri2uri.<locals>.<listcomp>Gs��.�.�.�Q�v�a�y�y�.�.�.r
)	�
isinstance�str�urllib�parse�urlsplitr�decode�
urlunsplitr)�uri�scheme�	authority�path�query�fragments      r�iri2urir(<s����#�s���0�5;�\�5J�5J�3�5O�5O�2���D�%���$�$�V�,�,�3�3�G�<�<�	��l�%�%�v�y�$��x�&P�Q�Q���g�g�.�.�#�.�.�.�/�/���Jr
�__main__c��eZdZd�Zd�ZdS)�Testc�^�gd�}|D]%}|�|t|�����&dS)z6Test that URIs are invariant under the transformation.)z"ftp://ftp.is.co.za/rfc/rfc1808.txtz#http://www.ietf.org/rfc/rfc2396.txtz)ldap://[2001:db8::7]/c=GB?objectClass?onezmailto:John.Doe@example.comz&news:comp.infosystems.www.servers.unixztel:+1-816-555-1212ztelnet://192.0.2.16:80/z3urn:oasis:names:specification:docbook:dtd:xml:4.1.2N)�assertEqualr()�self�	invariantr"s   r�	test_uriszTest.test_urisOsM��	�	�	�I�!�
4�
4��� � ��g�c�l�l�3�3�3�3�
4�
4r
c�0�|�dtd����|�dtd����|�dtd����|�dtd����|�d	td
����|�d	ttd
������|�d	td
�d������dS)
zFTest that the right type of escaping is done for each part of the URI.zhttp://xn--o3h.com/%E2%98%84uhttp://☄.com/☄z%http://bitworking.org/?fred=%E2%98%84uhttp://bitworking.org/?fred=☄z http://bitworking.org/#%E2%98%84uhttp://bitworking.org/#☄z
#%E2%98%84u#☄z/fred?bar=%E2%98%9A#%E2%98%84u/fred?bar=☚#☄rN)r-r(�assertNotEqualr)r.s r�test_iriz
Test.test_iri^s8�����.��8�9�9�
�
�
�
���7��?�@�@�
�
�
�
���2��:�;�;�
�
�
�
���\�7�<�+@�+@�A�A�A����/��K�L�L�
�
�
�
���/��� S�T�T�U�U�
�
�
�
���/��G�N�N�w�W�W���
�
�
�
�
r
N)�__name__�
__module__�__qualname__r0r3rr
rr+r+Ns2������
	4�
	4�
	4�	�	�	�	�	r
r+)�__doc__�
__author__�
__copyright__�__contributors__�__version__�__license__�urllib.parserrrr(r4�unittest�TestCaser+�mainrr
r�<module>rAs�����
0�
�.�
���������������0	�	�	�����z����O�O�O�,�,�,�,�,�x� �,�,�,�\�H�M�O�O�O�O�O�c�r