Ñò §ÚêLc@s_dZddklZedddƒ[ddkZddkZddgZeid ƒZeid ƒZeid ƒZ eid ƒZ eid ƒZ eidƒZ eidƒZ eidƒZeidƒZeidƒZeidƒZdefd„ƒYZdeifd„ƒYZdefd„ƒYZed„Zedjo eƒndS(s;A parser for SGML, using the derived class as a static DTD.iÿÿÿÿ(twarnpy3ks1the sgmllib module has been removed in Python 3.0t stackleveliNt SGMLParsertSGMLParseErrors[&<]sN&([a-zA-Z][a-zA-Z0-9]*|#[0-9]*)?|<([a-zA-Z][^<>]*|/([a-zA-Z][^<>]*)?|![^<>]*)?s%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]s&#([0-9]+)[^0-9]s <[>a-zA-Z]s<[a-zA-Z][-.a-zA-Z0-9]*/s"<([a-zA-Z][-.a-zA-Z0-9]*)/([^/]*)/t>s[<>]s[a-zA-Z][-_.a-zA-Z0-9]*se\s*([a-zA-Z_][-:.a-zA-Z_0-9]*)(\s*=\s*(\'[^\']*\'|"[^"]*"|[][\-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~\'"@]*))?cBseZdZRS(s&Exception raised for all parse errors.(t__name__t __module__t__doc__(((s/usr/lib64/python2.6/sgmllib.pyR,scBsieZeidƒZdd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d Z d „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zhdd6dd6dd6dd 6d!d"6Zd#„Zd$„Zd%„Zd&„Z d'„Z!d(„Z"d)„Z#d*„Z$d+„Z%d,„Z&RS(-s+&(?:([a-zA-Z][-.a-zA-Z0-9]*)|#([0-9]+))(;?)icCs||_|iƒdS(s#Initialize and reset this instance.N(tverbosetreset(tselfR((s/usr/lib64/python2.6/sgmllib.pyt__init__Bs cCsJd|_d|_g|_d|_d|_d|_tii |ƒdS(s0Reset this instance. Loses all unprocessed data.ts???iN( tNonet_SGMLParser__starttag_texttrawdatatstacktlasttagt nomoretagstliteralt markupbaset ParserBaseR (R ((s/usr/lib64/python2.6/sgmllib.pyR Gs      cCsd|_|_dS(sYEnter literal mode (CDATA) till EOF. Intended for derived classes only. iN(RR(R ((s/usr/lib64/python2.6/sgmllib.pyt setnomoretagsQscGs d|_dS(sPEnter literal mode (CDATA). Intended for derived classes only. iN(R(R targs((s/usr/lib64/python2.6/sgmllib.pyt setliteralXscCs!|i||_|idƒdS(sãFeed some data to the parser. Call this as often as you want, with as little or as much text as you want (may include ' '). (This just saves the text, all the processing is done by goahead().) iN(Rtgoahead(R tdata((s/usr/lib64/python2.6/sgmllib.pytfeed_scCs|idƒdS(sHandle the remaining data.iN(R(R ((s/usr/lib64/python2.6/sgmllib.pytclosejscCst|ƒ‚dS(N(R(R tmessage((s/usr/lib64/python2.6/sgmllib.pyterrornsc Csy|i}d}t|ƒ}x||jo |io|i|||!ƒ|}Pnti||ƒ}|o|iƒ}n|}||jo|i|||!ƒn|}||joPn||djoÀti||ƒoZ|i o"|i||ƒ|d}qn|i |ƒ}|djoPn|}qn|i d|ƒo7|i |ƒ}|djoPn|}d|_ qn|i o4||djo|idƒ|d}qPqn|i d|ƒo.|i |ƒ}|djoPn|}qn|i d|ƒo2|i|ƒ}|djoPn||}qn|i d|ƒo.|i|ƒ}|djoPn|}qq»n+||djo |i o"|i||ƒ|d}qnti||ƒ}|oU|idƒ}|i|ƒ|idƒ}||dd jo|d}qqnti||ƒ}|oU|idƒ}|i|ƒ|idƒ}||dd jo|d}qqq»n|id ƒti||ƒ}|p"|i||ƒ|d}qn|idƒ}||joPn|i|||!ƒ|}qW|o+||jo|i|||!ƒ|}n|||_dS( Nits!unexpected call to parse_starttagit't"R(R RRt shorttagopenR(tshorttagR0tlowerR2tfinish_shorttagt endbracketR%R&RttagfindRtattrfindtentity_or_charreftsubt _convert_reftappendtfinish_starttag( R R6t start_posRR(ttagRR9R8tattrstattrnametrestt attrvalue((s/usr/lib64/python2.6/sgmllib.pyR)îs`        && cCsŒ|idƒo,|i|idƒƒpd|iƒdS|idƒo+|i|idƒƒpd|idƒSd|idƒSdS(Nis&#%s%siis&%s;s&%s(R0tconvert_charreftgroupstconvert_entityref(R R(((s/usr/lib64/python2.6/sgmllib.pyRJ,scCs‡|i}ti||dƒ}|pdS|idƒ}||d|!iƒiƒ}||djo|d}n|i|ƒ|S(NiiÿÿÿÿiiR(RRER%R&tstripRCt finish_endtag(R R6RR(R8RN((s/usr/lib64/python2.6/sgmllib.pyR+7s  cCs.|i|gƒ|i|ƒ|i|ƒdS(N(RLR#RW(R RNR((s/usr/lib64/python2.6/sgmllib.pyRDDs cCs­yt|d|ƒ}Wnhtj o\yt|d|ƒ}Wn$tj o|i||ƒdSX|i|||ƒdSn)X|ii|ƒ|i|||ƒdSdS(Ntstart_tdo_iÿÿÿÿii(tgetattrtAttributeErrortunknown_starttagthandle_starttagRRK(R RNROtmethod((s/usr/lib64/python2.6/sgmllib.pyRLKs c Csq|p6t|iƒd}|djo|i|ƒdSn¡||ijoLyt|d|ƒ}Wn tj o|i|ƒnX|i|ƒdSt|iƒ}x2t|ƒD]$}|i||jo |}qµqµWxt|iƒ|jov|id}yt|d|ƒ}Wntj o d}nX|o|i||ƒn|i|ƒ|id=qàWdS(Niitend_iÿÿÿÿ( R"Rtunknown_endtagRZR[treport_unbalancedtrangeR t handle_endtag(R RNtfoundR^R6((s/usr/lib64/python2.6/sgmllib.pyRW]s8        cCs||ƒdS(N((R RNR^RO((s/usr/lib64/python2.6/sgmllib.pyR]|scCs |ƒdS(N((R RNR^((s/usr/lib64/python2.6/sgmllib.pyRc€scCs+|iod|dGHdG|iGHndS(Ns*** Unbalanced |i|ƒ}|djo|i|ƒn|i|ƒdS(s0Handle character reference, no need to override.N(RSR tunknown_charrefR#(R R:t replacement((s/usr/lib64/python2.6/sgmllib.pyR1–s RtltRtgtR tampR@tquots'taposcCs'|i}||jo ||SdSdS(sµConvert entity references. As an alternative to overriding this method; one can tailor the results by setting up the self.entitydefs mapping appropriately. N(t entitydefs(R R:ttable((s/usr/lib64/python2.6/sgmllib.pyRU¢s   cCs>|i|ƒ}|djo|i|ƒn|i|ƒdS(s.Handle entity references, no need to override.N(RUR tunknown_entityrefR#(R R:Rk((s/usr/lib64/python2.6/sgmllib.pyR4®s cCsdS(N((R R((s/usr/lib64/python2.6/sgmllib.pyR#·scCsdS(N((R R((s/usr/lib64/python2.6/sgmllib.pythandle_comment»scCsdS(N((R tdecl((s/usr/lib64/python2.6/sgmllib.pyt handle_decl¿scCsdS(N((R R((s/usr/lib64/python2.6/sgmllib.pyR=ÃscCsdS(N((R RNRO((s/usr/lib64/python2.6/sgmllib.pyR\ÇscCsdS(N((R RN((s/usr/lib64/python2.6/sgmllib.pyR`ÈscCsdS(N((R tref((s/usr/lib64/python2.6/sgmllib.pyRjÉscCsdS(N((R Rw((s/usr/lib64/python2.6/sgmllib.pyRsÊs('RRtretcompileRHR R RRRRRRt_decl_othercharsR-R>R)RJR+RDRLRWR]RcRaRSRgR1RqRUR4R#RtRvR=R\R`RjRs(((s/usr/lib64/python2.6/sgmllib.pyR<sF      g  >        )       tTestSGMLParsercBseeZdd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z RS( icCsd|_ti||ƒdS(NR (ttestdataRR (R R((s/usr/lib64/python2.6/sgmllib.pyR Ïs cCs>|i||_tt|iƒƒdjo|iƒndS(NiF(R|R"treprtflush(R R((s/usr/lib64/python2.6/sgmllib.pyR#ÓscCs0|i}|od|_dGt|ƒGHndS(NR sdata:(R|R}(R R((s/usr/lib64/python2.6/sgmllib.pyR~Øs  cCsP|iƒt|ƒ}t|ƒdjo|d d|d}ndG|GHdS(NiDi s...iàÿÿÿscomment:(R~R}R"(R Rtr((s/usr/lib64/python2.6/sgmllib.pyRtÞs   cCs^|iƒ|pd|dGHn9d|Gx(|D] \}}|dd|dGq1WdGHdS(Ns start tag: s4      ÿ’7 $