Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/httplib2/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/httplib2/iri2uri.pyc

ó
âQÁNc@sÌdZdZdZgZdZdZdZddlZd5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHgZd0„Z	d1„Z
ed2krÈddlZd3ej
fd4„ƒYZejƒndS(Is%
iri2uri

Converts an IRI to a URI.

s!Joe Gregorio (joe@bitworking.org)sCopyright 2006, Joe Gregorios1.0.0tMITt
iÿÿÿÿNi 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ýÿcCsŽ|}t|ƒ}xutD]m\}}||kr5Pn||kr||krdjg|jdƒD]}dt|ƒ^qcƒ}PqqW|S(Ntsutf-8s%%%2X(tordtescape_rangetjointencode(tctretvaltitlowthighto((s4/usr/lib/python2.7/dist-packages/httplib2/iri2uri.pyR5s5cCs‰t|tƒr…tj|ƒ\}}}}}|jdƒ}tj|||||fƒ}djg|D]}t|ƒ^qgƒ}n|S(sŸ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.tidnaR(t
isinstancetunicodeturlparseturlsplitRt
urlunsplitR(turitschemet	authoritytpathtquerytfragmentR((s4/usr/lib/python2.7/dist-packages/httplib2/iri2uri.pytiri2uriAs+t__main__tTestcBseZd„Zd„ZRS(cCsIddddddddg}x$|D]}|j|t|ƒƒq%Wd	S(
s6Test that URIs are invariant under the transformation.u"ftp://ftp.is.co.za/rfc/rfc1808.txtu#http://www.ietf.org/rfc/rfc2396.txtu)ldap://[2001:db8::7]/c=GB?objectClass?oneumailto:John.Doe@example.comu&news:comp.infosystems.www.servers.unixutel:+1-816-555-1212utelnet://192.0.2.16:80/u3urn:oasis:names:specification:docbook:dtd:xml:4.1.2N(tassertEqualR(tselft	invariantR((s4/usr/lib/python2.7/dist-packages/httplib2/iri2uri.pyt	test_urisTs	
cCs­|jdtdƒƒ|jdtdƒƒ|jdtdƒƒ|jdtdƒƒ|jd	td
ƒƒ|jd	ttd
ƒƒƒ|jd	td
jdƒƒƒdS(
sG Test that the right type of escaping is done for each part of the URI.shttp://xn--o3h.com/%E2%98%84uhttp://☄.com/☄s%http://bitworking.org/?fred=%E2%98%84uhttp://bitworking.org/?fred=☄s http://bitworking.org/#%E2%98%84uhttp://bitworking.org/#☄s
#%E2%98%84u#☄s/fred?bar=%E2%98%9A#%E2%98%84u/fred?bar=☚#☄sutf-8N(RRtassertNotEqualR(R((s4/usr/lib/python2.7/dist-packages/httplib2/iri2uri.pyttest_iribs(t__name__t
__module__RR!(((s4/usr/lib/python2.7/dist-packages/httplib2/iri2uri.pyRRs	(i 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ýÿ(t__doc__t
__author__t
__copyright__t__contributors__t__version__t__license__t__history__RRRRR"tunittesttTestCaseRtmain(((s4/usr/lib/python2.7/dist-packages/httplib2/iri2uri.pyt<module>sB