Files
PowerToys/PythonHome/Lib/markupbase.pyc

38 lines
9.6 KiB
Plaintext
Raw Normal View History

2014-07-09 18:15:23 +08:00
<03>
<EFBFBD>W`Sc@s}dZddlZejd<00>jZejd<00>jZejd<00>Zejd<00>Zejd<00>Z[dd
d <00><00>YZ dS( s<>Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the HTMLParser and sgmllib
modules (indirectly, for htmllib as well). It has no documented
public API and should not be used directly.
i<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ns[a-zA-Z][-_.a-zA-Z0-9]*\s*s(\'[^\']*\'|"[^"]*")\s*s--\s*>s ]\s*]\s*>s]\s*>t
ParserBasecBs<>eZdZd<00>Zd<00>Zd<00>Zd<00>Zd<00>ZdZd<00>Z dd <00>Z
dd
<00>Z d <00>Z d <00>Z d <00>Zd<00>Zd<00>Zd<00>Zd<00>ZRS(siParser base class which provides some common support methods used
2014-07-10 23:57:08 +08:00
by the SGML/HTML and XHTML parsers.cCs"|jtkrtd<00><00>ndS(Ns(markupbase.ParserBase must be subclassed(t __class__Rt RuntimeError(tself((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyt__init__scCstd<00><00>dS(Ns.subclasses of ParserBase must override error()(tNotImplementedError(Rtmessage((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyterror!scCsd|_d|_dS(Nii(tlinenotoffset(R((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pytreset%s cCs|j|jfS(s&Return current line number and offset.(RR (R((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pytgetpos)scCs<>||kr|S|j}|jd||<00>}|rm|j||_|jd||<00>}||d|_n|j|||_|S(Ns
i(trawdatatcountRtrindexR (RtitjR tnlinestpos((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyt updatepos1s  tc
2014-07-09 18:15:23 +08:00
Cse|j}|d}|||!dks2td<00><00>|||d!dkrQ|dS|||d!dkrldSt|<00>}|||d!d kr<>|j|<00>S||d
kr<>|j|<00>S|j||<00>\}}|d kr<>|S|d kr<>d|_nxe||kr`||}|dkr`||d|!}|d krK|j|<00>n |j|<00>|dS|d kr<>t ||<00>}|s<>dS|j
<00>}n<>|dkr<>|j||<00>\} }n<>||jkr<>|d}nv|d
kr8|d kr|j |d|<00>}qM|dkr(|j d|<16>qM|j d<00>n|j d||<16>|d kr<>|Sq<53>WdS(Nis<!s$unexpected call to parse_declarationit>t-Ri<><69><EFBFBD><EFBFBD>s--t[itdoctypes"'t4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZtattlisttlinktypetlinktelements&unsupported '[' char in %s declarations"unexpected '[' char in declarations!unexpected %r char in declaration(RR(RRslinkselement( R tAssertionErrortlent parse_commenttparse_marked_sectiont
_scan_namet_decl_othercharst handle_declt unknown_declt_declstringlit_matchtendt_parse_doctype_subsetR(
2014-07-10 23:57:08 +08:00
RRR Rtntdecltypetctdatatmtname((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pytparse_declarationAsZ 
2014-07-09 18:15:23 +08:00
      
          icCs|j}|||d!dks,td<00><00>|j|d|<00>\}}|dkrX|S|dkr}tj||d<17>}nA|dkr<>tj||d<17>}n|jd ||d|!<16>|s<>dS|r<>|jd<00>}|j||d|!<21>n|j d<00>S(Nis<![s)unexpected call to parse_marked_section()ittemptcdatatignoretincludetrcdatatiftelsetendifs+unknown status keyword %r in marked sectioni<6E><69><EFBFBD><EFBFBD>(stempR1signoresincludeR4(sifselseR7(
2014-07-10 23:57:08 +08:00
R RR"t_markedsectionclosetsearcht_msmarkedsectioncloseRtstartR%R'(RRtreportR tsectNameRtmatch((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyR!<00>s  #   cCs<>|j}|||d!dkr0|jd<00>ntj||d<17>}|sPdS|r<>|jd<00>}|j||d|!<21>n|jd<00>S(Nis<!--s"unexpected call to parse_comment()i<><69><EFBFBD><EFBFBD>i(R Rt _commentcloseR9R;thandle_commentR'(RRR<R R>R((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyR <00>s c
2014-07-09 18:15:23 +08:00
Cs<>|j}t|<00>}|}x<>||kr<>||}|dkr<>|||d!}|dkradS|dkr<>|j||d<17>|jd|<16>n|d|kr<>dS|d|kr<>dS|||d!dkr<>|j|d d
<00>}|d
kr|Sqn|j|d|<00>\}}|dkr+dS|dkr_|j||d<17>|jd|<16>nt|d|<17>} | ||<00>}|d
kr<>|Sq|dkr|d|kr<>dS|j|d|<00>\}}|d
2014-07-10 23:57:08 +08:00
kr<>|S||dkr<>|d}q<>q|dkr<>|d}x*||krB||j<00>rB|d}qW||kr<>||dkrc|S|j||<00>|jd<00>q<>dSq|j<00>r<>|d}q|j||<00>|jd|<16>qWdS(Nt<ii<><69><EFBFBD><EFBFBD>s<!is*unexpected char in internal subset (in %r)is<!--R<iRRtentitytnotations)unknown declaration %r in internal subsett_parse_doctype_t%t;t]Rs%unexpected char after internal subsets%unexpected char %r in internal subset(sattlistselementsentityRC(R RRRR R"tgetattrtisspace(
RRt declstartposR R)RR+tsR.tmeth((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyR(<00>sn  
2014-07-09 18:15:23 +08:00
          
2014-07-10 23:57:08 +08:00
   cCsY|j||<00>\}}|dkr(dS|j}d||krU|jd|<00>dSdS(Ni<4E><69><EFBFBD><EFBFBD>Ri(R"R tfind(RRRJR.RR ((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyt_parse_doctype_element<6E>s  cCs|j}|j||<00>\}}|||d!}|dkrBdS|dkrV|dSx<53>|j||<00>\}}|dkr<>|S|||d!}|dkr<>dS|dkrd||kr<>|jd|<00>d}ndSx%|||d!j<00>r|d}q<>W||s,dSn|j||<00>\}}|||d!}|sGdS|dkr<>t||<00>}|rw|j<00>}ndS|||d!}|s<>dSn|d kr||d kr<>dS|j|d|<00>\}}|dkr<>|S|||d!}|sdSn|dkrY|dSqYdS(
NiRi<><69><EFBFBD><EFBFBD>Rit(t)s'"t#(R R"RMRIR&R'(RRRJR R.RR+R-((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyt_parse_doctype_attlistsZ      
    cCs<>|j||<00>\}}|dkr(|S|j}x<>|||d!}|sOdS|dkrc|dS|dkr<>t||<00>}|s<>dS|j<00>}q4|j||<00>\}}|dkr4|Sq4dS(Niii<><69><EFBFBD><EFBFBD>Rs'"(R"R R&R'(RRRJR.RR R+R-((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyt_parse_doctype_notation>s$     cCs1|j}|||d!dkrh|d}xA|||d!}|sHdS|j<00>ra|d}q-Pq-n|}|j||<00>\}}|dkr<>|Sx<53>|j||d!}|s<>dS|dkr<>t||<00>}|r<>|j<00>}q*dSq<53>|dkr|dS|j||<00>\}}|dkr<>|Sq<53>dS(NiREi<><69><EFBFBD><EFBFBD>is'"R(R RIR"R&R'(RRRJR RR+R.R-((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyt_parse_doctype_entityUs8 
2014-07-09 18:15:23 +08:00
      cCs<>|j}t|<00>}||kr%dSt||<00>}|r<>|j<00>}|j<00>}|t|<00>|krldS|j<00>|j<00>fS|j||<00>|j d|||d!<16>dS(Ni<4E><69><EFBFBD><EFBFBD>sexpected name token at %ri(Ni<4E><69><EFBFBD><EFBFBD>(Ni<4E><69><EFBFBD><EFBFBD>(
2014-07-10 23:57:08 +08:00
R RtNonet_declname_matchtgrouptstriptlowerR'RR(RRRJR R)R-RKR.((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyR"ys      cCsdS(N((RR,((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyR%<00>s(t__name__t
2014-07-09 18:15:23 +08:00
__module__t__doc__RRR
2014-07-10 23:57:08 +08:00
R RR#R/R!R R(RNRRRSRTR"R%(((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyRs"      R   C 9  $ ((
R\tretcompileR>RVR&R?R8R:R(((s?e:\github\Wox.JSONRPC\Output\Debug\PythonHome\lib\markupbase.pyt<module>s