ó x‹Å^c@sÆdZdZdZgZdZdZddlZd4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGgZd/„Zd0„Z e d1krÂddl Z d2e j fd3„ƒYZ e jƒndS(HsConverts an IRI to a URI.s!Joe Gregorio (joe@bitworking.org)sCopyright 2006, Joe Gregorios1.0.0tMITiÿÿÿÿNi iÿ×iàiÿøiùiÏýiðýiïÿiiýÿiiýÿiiýÿiiýÿiiýÿiiýÿiiýÿiiýÿi iýÿ i iýÿ i iýÿ 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/site-packages/httplib2/iri2uri.pyR/s  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/site-packages/httplib2/iri2uri.pytiri2uri;s +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(t assertEqualR(tselft invariantR((s4/usr/lib/python2.7/site-packages/httplib2/iri2uri.pyt test_urisNs  cCs­|jdtdƒƒ|jdtdƒƒ|jdtdƒƒ|jdtdƒƒ|jd td ƒƒ|jd ttd ƒƒƒ|jd td jd ƒƒƒd S( sFTest 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/site-packages/httplib2/iri2uri.pyttest_iri]s(    (t__name__t __module__RR (((s4/usr/lib/python2.7/site-packages/httplib2/iri2uri.pyRMs (i iÿ×(iàiÿø(iùiÏý(iðýiïÿ(iiýÿ(iiýÿ(iiýÿ(iiýÿ(iiýÿ(iiýÿ(iiýÿ(iiýÿ(i iýÿ (i iýÿ (i iýÿ (i iýÿ (i iýÿ (iiýÿ(iiýÿ(iiýÿ(t__doc__t __author__t __copyright__t__contributors__t __version__t __license__RRRRR!tunittesttTestCaseRtmain(((s4/usr/lib/python2.7/site-packages/httplib2/iri2uri.pyts@     .