Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/httplib2/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/httplib2/__pycache__/iri2uri.cpython-38.pyc
U

O��g9�@s�dZdZdZgZdZdZddlZddd	d
ddd
dddddddddddddgZdd�Z	dd�Z
edkr�ddlZGd d!�d!ej
�Ze��dS)"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��cCsX|}t|�}tD]B\}}||kr$qT||kr||krd�dd�|�d�D��}qTq|S)N�cSsg|]}d|�qS)z%%%2X�)�.0�orr�=/opt/cppython/lib/python3.8/site-packages/httplib2/iri2uri.py�
<listcomp>7szencode.<locals>.<listcomp>�utf-8)�ord�escape_range�join�encode)�c�retval�i�low�highrrrr0srcCs^t|t�rZtj�|�\}}}}}|�d��d�}tj�|||||f�}d�dd�|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.�idnar
rcSsg|]}t|��qSr)r)rrrrrr	Gsziri2uri.<locals>.<listcomp>)	�
isinstance�str�urllib�parse�urlsplitr�decode�
urlunsplitr
)�uri�scheme�	authority�path�query�fragmentrrr�iri2uri<s
r"�__main__c@seZdZdd�Zdd�ZdS)�TestcCs2ddddddddg}|D]}|�|t|��qd	S)
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")�selfZ	invariantrrrr�	test_urisOs�
zTest.test_uriscCs~|�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=☚#☄r
N)r%r"ZassertNotEqualr)r&rrr�test_iri^s6����
���z
Test.test_iriN)�__name__�
__module__�__qualname__r'r(rrrrr$Nsr$)�__doc__�
__author__�
__copyright__Z__contributors__�__version__�__license__�urllib.parserrrr"r)ZunittestZTestCaser$�mainrrrr�<module>sB�.

F1le Man4ger