Critics have remarked that those four worthies were truly peerless throughout the ages; yet the present falls short of the pastβ€”the ancients favored unadorned simplicity, whereas the moderns prefer refined elegance. Styles of substance and ornament rise and fall in succession, shifting with the changing mores of the times; such evolution is simply the natural order of things. The ideal lies in honoring antiquity without clashing with the present, and embracing modernity without succumbing to its flawsβ€”embodying that perfect balance of substance and refinement that defines the true gentleman. There is surely no need to abandon a carved palace in favor of a cave dwelling, or to trade a jade carriage for a primitive cart with solid wooden wheels.🌌 SpectraShell

🌌 SpectraShell

Current path: lib64/python2.7/



⬆️ Go up: /lib64

πŸ“„ Viewing: HTMLParser.pyc

οΏ½
zfc@sdZddlZddlZejdοΏ½ZejdοΏ½ZejdοΏ½ZejdοΏ½ZejdοΏ½ZejdοΏ½Z	ejd	οΏ½Z
ejd
οΏ½ZejdοΏ½ZejdοΏ½Z
ejd
ejοΏ½ZejdοΏ½ZejdοΏ½ZdefdοΏ½οΏ½YZdejfdοΏ½οΏ½YZdS(sA parser for HTML and XHTML.iοΏ½οΏ½οΏ½οΏ½Ns[&<]s
&[a-zA-Z#]s%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]s)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]s	<[a-zA-Z]t>s--\s*>s$([a-zA-Z][^	

 />]*)(?:\s|/(?!>))*s[a-zA-Z][^	

 />]*s]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*s
  <[a-zA-Z][^\t\n\r\f />\x00]*       # tag name
  (?:[\s/]*                          # optional whitespace before attribute name
    (?:(?<=['"\s/])[^\s/>][^\s/=>]*  # attribute name
      (?:\s*=+\s*                    # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |"[^"]*"                   # LIT-enclosed value
          |(?!['"])[^>\s]*           # bare value
         )
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
s#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>tHTMLParseErrorcBs#eZdZddοΏ½ZdοΏ½ZRS(s&Exception raised for all parse errors.cCs3|stοΏ½||_|d|_|d|_dS(Nii(tAssertionErrortmsgtlinenotoffset(tselfRtposition((s"/usr/lib64/python2.7/HTMLParser.pyt__init__<s	
cCsW|j}|jdk	r,|d|j}n|jdk	rS|d|jd}n|S(Ns, at line %ds, column %di(RRtNoneR(Rtresult((s"/usr/lib64/python2.7/HTMLParser.pyt__str__Bs	N(NN(t__name__t
__module__t__doc__R	RR(((s"/usr/lib64/python2.7/HTMLParser.pyR9st
HTMLParsercBs
eZdZdZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdZ
dοΏ½Zd	οΏ½Zd
οΏ½Z
dοΏ½ZdοΏ½Zd
dοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdZdοΏ½Z RS( sοΏ½Find tags and other markup and call handler functions.

    Usage:
        p = HTMLParser()
        p.feed(data)
        ...
        p.close()

    Start tags are handled by calling self.handle_starttag() or
    self.handle_startendtag(); end tags by self.handle_endtag().  The
    data between tags is passed from the parser to the derived class
    by calling self.handle_data() with the data as argument (the data
    may be split up in arbitrary chunks).  Entity references are
    passed by calling self.handle_entityref() with the entity
    reference as the argument.  Numeric character references are
    passed to self.handle_charref() with the string containing the
    reference as the argument.
    tscripttstylecCs|jοΏ½dS(s#Initialize and reset this instance.N(treset(R((s"/usr/lib64/python2.7/HTMLParser.pyRbscCs8d|_d|_t|_d|_tjj|οΏ½dS(s1Reset this instance.  Loses all unprocessed data.ts???N(	trawdatatlasttagtinteresting_normaltinterestingR	t
cdata_elemt
markupbaset
ParserBaseR(R((s"/usr/lib64/python2.7/HTMLParser.pyRfs
				cCs!|j||_|jdοΏ½dS(sοΏ½Feed data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '\n').
        iN(Rtgoahead(Rtdata((s"/usr/lib64/python2.7/HTMLParser.pytfeednscCs|jdοΏ½dS(sHandle any buffered data.iN(R(R((s"/usr/lib64/python2.7/HTMLParser.pytclosewscCst||jοΏ½οΏ½οΏ½dS(N(Rtgetpos(Rtmessage((s"/usr/lib64/python2.7/HTMLParser.pyterror{scCs|jS(s)Return full source of start tag: '<...>'.(t_HTMLParser__starttag_text(R((s"/usr/lib64/python2.7/HTMLParser.pytget_starttag_textοΏ½scCs2|jοΏ½|_tjd|jtjοΏ½|_dS(Ns</\s*%s\s*>(tlowerRtretcompiletIR(Rtelem((s"/usr/lib64/python2.7/HTMLParser.pytset_cdata_modeοΏ½scCst|_d|_dS(N(RRR	R(R((s"/usr/lib64/python2.7/HTMLParser.pytclear_cdata_modeοΏ½s	c
Cs||j}d}t|οΏ½}x||kr%|jj||οΏ½}|rT|jοΏ½}n|jraPn|}||krοΏ½|j|||!οΏ½n|j||οΏ½}||krοΏ½Pn|j}|d|οΏ½r7t	j
||οΏ½rοΏ½|j|οΏ½}nοΏ½|d|οΏ½r	|j|οΏ½}nοΏ½|d|οΏ½r*|j
|οΏ½}nm|d|οΏ½rK|j|οΏ½}nL|d|οΏ½rl|j|οΏ½}n+|d|krοΏ½|jdοΏ½|d}nP|dkr"|sοΏ½Pn|jd|dοΏ½}|dkr|jd|dοΏ½}|dkr|d}qn
|d7}|j|||!οΏ½n|j||οΏ½}q|d	|οΏ½rtj
||οΏ½}|rοΏ½|jοΏ½d
d!}	|j|	οΏ½|jοΏ½}|d|dοΏ½sοΏ½|d}n|j||οΏ½}qq"d||kr|j|||d
!οΏ½|j||d
οΏ½}nPq|d
|οΏ½rtj
||οΏ½}|rοΏ½|jdοΏ½}	|j|	οΏ½|jοΏ½}|d|dοΏ½sv|d}n|j||οΏ½}qntj
||οΏ½}|rοΏ½|rοΏ½|jοΏ½||krοΏ½|jdοΏ½nPq"|d|kr|jd
οΏ½|j||dοΏ½}q"PqdstdοΏ½οΏ½qW|rk||krk|jrk|j|||!οΏ½|j||οΏ½}n|||_dS(Nit<s</s<!--s<?s<!iRs&#iiοΏ½οΏ½οΏ½οΏ½t;t&s#EOF in middle of entity or char refsinteresting.search() lied(RtlenRtsearchtstartRthandle_datat	updatepost
startswithtstarttagopentmatchtparse_starttagtparse_endtagt
parse_commenttparse_pitparse_html_declarationtfindtcharreftgroupthandle_charreftendt	entityrefthandle_entityreft
incompleteR!R(
RR?RtitnR5tjR3tktname((s"/usr/lib64/python2.7/HTMLParser.pyRοΏ½sοΏ½			







cCsοΏ½|j}|||d!dkr0|jdοΏ½n|||d!dkrT|j|οΏ½S|||d!dkrx|j|οΏ½S|||d!jοΏ½d	krοΏ½|jd
|dοΏ½}|dkrοΏ½dS|j||d|!οΏ½|dS|j|οΏ½SdS(
Nis<!s+unexpected call to parse_html_declaration()is<!--is<![i	s	<!doctypeRiοΏ½οΏ½οΏ½οΏ½i(RR!R8tparse_marked_sectionR$R;thandle_decltparse_bogus_comment(RRCRtgtpos((s"/usr/lib64/python2.7/HTMLParser.pyR:οΏ½s	

icCs|j}|||d!dkr0|jdοΏ½n|jd|dοΏ½}|dkrVdS|rw|j||d|!οΏ½n|dS(	Nis<!s</s"unexpected call to parse_comment()RiοΏ½οΏ½οΏ½οΏ½i(s<!s</(RR!R;thandle_comment(RRCtreportRtpos((s"/usr/lib64/python2.7/HTMLParser.pyRJs	cCsοΏ½|j}|||d!dks,tdοΏ½οΏ½tj||dοΏ½}|sLdS|jοΏ½}|j||d|!οΏ½|jοΏ½}|S(Nis<?sunexpected call to parse_pi()iοΏ½οΏ½οΏ½οΏ½(RRtpicloseR/R0t	handle_piR?(RRCRR5RE((s"/usr/lib64/python2.7/HTMLParser.pyR9s	#cCsοΏ½d|_|j|οΏ½}|dkr(|S|j}|||!|_g}tj||dοΏ½}|sotdοΏ½οΏ½|jοΏ½}|jdοΏ½j	οΏ½|_
}xοΏ½||krοΏ½tj||οΏ½}|sοΏ½Pn|jdddοΏ½\}	}
}|
sοΏ½d}nX|d dko|dkns7|d dko2|dknrG|dd!}n|r_|j|οΏ½}n|j
|	j	οΏ½|fοΏ½|jοΏ½}qοΏ½W|||!jοΏ½}|dkr+|jοΏ½\}
}d|jkr|
|jjdοΏ½}
t|jοΏ½|jjdοΏ½}n|t|jοΏ½}|j|||!οΏ½|S|jd
οΏ½rM|j||οΏ½n/|j||οΏ½||jkr||j|οΏ½n|S(
Niis#unexpected call to parse_starttag()iis'iοΏ½οΏ½οΏ½οΏ½t"Rs/>s
(Rs/>(R	R"tcheck_for_whole_start_tagRttagfindR5RR?R=R$RtattrfindtunescapetappendtstripRtcountR.trfindR1tendswiththandle_startendtagthandle_starttagtCDATA_CONTENT_ELEMENTSR)(RRCtendposRtattrsR5RFttagtmtattrnametrestt	attrvalueR?RR((s"/usr/lib64/python2.7/HTMLParser.pyR6sR			$$cCsοΏ½|j}tj||οΏ½}|rοΏ½|jοΏ½}|||d!}|dkrR|dS|dkrοΏ½|jd|οΏ½rx|dS|jd|οΏ½rοΏ½dS|j||dοΏ½|jdοΏ½n|dkrοΏ½dS|d	krοΏ½dS||krοΏ½|S|dSntd
οΏ½οΏ½dS(NiRt/s/>iiοΏ½οΏ½οΏ½οΏ½smalformed empty start tagRs6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZswe should not get here!(RtlocatestarttagendR5R?R3R2R!R(RRCRRaREtnext((s"/usr/lib64/python2.7/HTMLParser.pyRRNs,	cCsοΏ½|j}|||d!dks,tdοΏ½οΏ½tj||dοΏ½}|sLdS|jοΏ½}tj||οΏ½}|s$|jdk	rοΏ½|j	|||!οΏ½|St
j||dοΏ½}|sοΏ½|||d!dkrοΏ½|dS|j|οΏ½Sn|jdοΏ½j
οΏ½}|jd|jοΏ½οΏ½}|j|οΏ½|dS|jdοΏ½j
οΏ½}|jdk	rr||jkrr|j	|||!οΏ½|Sn|j|οΏ½|jοΏ½|S(	Nis</sunexpected call to parse_endtagiiοΏ½οΏ½οΏ½οΏ½is</>R(RRt	endendtagR/R?t
endtagfindR5RR	R1RSRJR=R$R;t
handle_endtagR*(RRCRR5RKt	namematchttagnameR(((s"/usr/lib64/python2.7/HTMLParser.pyR7ns8	#


cCs!|j||οΏ½|j|οΏ½dS(N(R\Rj(RR`R_((s"/usr/lib64/python2.7/HTMLParser.pyR[οΏ½scCsdS(N((RR`R_((s"/usr/lib64/python2.7/HTMLParser.pyR\οΏ½scCsdS(N((RR`((s"/usr/lib64/python2.7/HTMLParser.pyRjοΏ½scCsdS(N((RRG((s"/usr/lib64/python2.7/HTMLParser.pyR>οΏ½scCsdS(N((RRG((s"/usr/lib64/python2.7/HTMLParser.pyRAοΏ½scCsdS(N((RR((s"/usr/lib64/python2.7/HTMLParser.pyR1οΏ½scCsdS(N((RR((s"/usr/lib64/python2.7/HTMLParser.pyRLοΏ½scCsdS(N((Rtdecl((s"/usr/lib64/python2.7/HTMLParser.pyRIοΏ½scCsdS(N((RR((s"/usr/lib64/python2.7/HTMLParser.pyRPοΏ½scCsdS(N((RR((s"/usr/lib64/python2.7/HTMLParser.pytunknown_declοΏ½scs2d|kr|SοΏ½fdοΏ½}tjd||οΏ½S(NR-cs|jοΏ½d}yZ|ddkri|d}|dd
krSt|ddοΏ½}nt|οΏ½}t|οΏ½SWntk
rοΏ½d|dSXtjdkrοΏ½d	dl}id
d6}x-|jj	οΏ½D]\}}t|οΏ½||<qοΏ½W|t_nyοΏ½j|SWnt
k
rd|dSXdS(Nit#itxtXis&#R,iοΏ½οΏ½οΏ½οΏ½u'taposR-(RpRq(tgroupstinttunichrt
ValueErrorRt
entitydefsR	thtmlentitydefstname2codepointt	iteritemstKeyError(tstcRxRwRFtv(R(s"/usr/lib64/python2.7/HTMLParser.pytreplaceEntitiesοΏ½s(




s#&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));(R%tsub(RR|R((Rs"/usr/lib64/python2.7/HTMLParser.pyRUοΏ½s(RRN(!RR
RR]RRRRR!R	R"R#R)R*RR:RJR9R6RRR7R[R\RjR>RAR1RLRIRPRnRwRU(((s"/usr/lib64/python2.7/HTMLParser.pyRKs<										^			4	 	(										(RRR%R&RRBR@R<R4ROtcommentcloseRSttagfind_tolerantRTtVERBOSERfRhRit	ExceptionRRR(((s"/usr/lib64/python2.7/HTMLParser.pyt<module>s&
	



πŸ“