Ñò ›ˆQc@sÎdZdZdZgZdZdZdZddkZd5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHgZd0„Z d1„Z e d2jo3ddk Z d3e i fd4„ƒYZe iƒ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ýÿ i iýÿ i iýÿ i iýÿ iiýÿiiýÿiiýÿcCs›|}t|ƒ}x‚tD]z\}}||joPn||joO||joBdig}|idƒD]}|dt|ƒqk~ƒ}PqqW|S(Ntsutf-8s%%%2X(tordt escape_rangetjointencode(tctretvaltitlowthight_[1]to((sQ/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/httplib2/httplib2/iri2uri.pyR5s   = cCs“t|tƒoti|ƒ\}}}}}|idƒ}ti|||||fƒ}dig}|D]}|t|ƒql~ƒ}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 R((sQ/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/httplib2/httplib2/iri2uri.pytiri2uriAs 4t__main__tTestcBseZd„Zd„ZRS(cCsIddddddddg}x$|D]}|i|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((sQ/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/httplib2/httplib2/iri2uri.pyt test_urisTs cCs­|idtdƒƒ|idtdƒƒ|idtdƒƒ|idtdƒƒ|id td ƒƒ|id ttd ƒƒƒ|id td id ƒƒƒ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((sQ/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/httplib2/httplib2/iri2uri.pyttest_iribs(t__name__t __module__R R"(((sQ/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/httplib2/httplib2/iri2uri.pyRRs (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__t __history__RRRRR#tunittesttTestCaseRtmain(((sQ/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/httplib2/httplib2/iri2uri.pytsB