mò v Lc@s¦dZdZdZdZdklZdklZlZl Z l Z dk l Z dk lZdkZed ƒd \ZZd Zd ed ZdZeeZhdd<dd<dd<dd<dd<dd<dd<dd<dd<d ds $Revision$s&Copyright (c) 2004, 2007 Joseph Walton(surljoin(squotes quote_plussunquotes unquote_plus(s normalize(slookupNsUTF-8is !$&'()*+,;=s-._~s:@s:/?#[]@tftpittelnetithttpiPtgopheriFtnewsiwtnntptprosperoi¿thttpsi»tsnewsi3tsnntptBadUricBstZRS(N(t__name__t __module__(((t</web/script/rubys/feedvalidator.org/src/feedvalidator/uri.pyR 'scCs!ttdt|ƒdƒƒdS(NtNFCi(tenct normalizetdects(R((R t_n*ss([^%]|%[a-fA-F0-9]{2})ccsšx“|o‹ti|ƒ}|p tƒ‚n|idƒ}|ddjo'|iƒtt |ddƒƒfVn ||fV||i dƒ}qWdS(Niit%i( RtoctetRetmatchtmR tgrouptctuppertchrtinttend(RRR((R tasOctets/s ' tcCsÄ|djodSnt|ƒ}d}d}xqt|ƒD]c\}}|tjo@||jo3|t t t |ƒƒ|ƒ7}d}||7}q:||7}q:W|t t t |ƒƒ|ƒ7}|S(NR( RtNonetstrtrestbRRtxtRESERVEDtsafetquoteRtunquote(RR&R#R"RR$((R t_qnu>s   s:(\d*)$cCs |iƒ}|}ti|ƒ}|oJ|idƒdjot |idƒƒ}n||i dƒd }n|o;|ddjo*|i dddƒdjo|d }n|i dƒ|i dƒjo tƒ‚n||jo|d t|ƒ}n|S( NiRiÿÿÿÿt.iiþÿÿÿt[t]t:(tnetloctlowertnltdefPorttptportRetsearchRRRtstarttrfindt startswithtendswithR R!(R.R1R0RR2((R t _normPortWs 4  cCsŒ|idƒ}|djo3|| }|djo d}n||d}n d}|}|o|dt||ƒSnt||ƒSdS(Nt@iR-Ri(tauthR6tiRthR R9tport(R;R>RR<R=((R t _normAuthls    cCsk|idƒ}d}|o|dot|ƒ}nxà|t|ƒjoÌ||}|djo0|t|ƒdjo ||=qd||        tUricBs2tZdZd„Zd„Zd„Zd„ZRS(sbA Uri wraps a string and performs equality testing according to the rules for URI equivalence. cCs||_t|ƒ|_dS(N(RtselfRUtn(RWR((R t__init__Ús cCs|iS(N(RWR(RW((R t__str__ÞscCs t|iƒS(N(treprRWR(RW((R t__repr__áscCs|i|ijS(N(RWRXRQ(RWRQ((R t__eq__äs(R R t__doc__RYRZR\R](((R RV×s    cCsByt|ƒSWn-tj o dSntj o dSnXdS(sbGive the canonical form for a URI, so char-by-char comparisons become valid tests for equivalence.N(RUtuR R t UnicodeError(R_((R t canonicalFormçs(&R^t __author__t __version__t __copyright__turlparseturljointurllibR't quote_plusR(t unquote_plust unicodedataRtcodecstlookuptreRRt SUBDELIMSREt GENDELIMSR%RRt ExceptionR RtcompileRRR)R3R9R?RFRKRURVRa(R(RURRoRFRRRRR3R9RiR RmRaRlRcRfRER%R'RVRbRhR?R)RdRRKRRRn((R RIs8     `        >