%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/markupbase.pyc


Mac@s}dZddlZejdjZejdjZejdZejdZejdZ[dd
d	YZ	dS(sShared 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.

iNs[a-zA-Z][-_.a-zA-Z0-9]*\s*s(\'[^\']*\'|"[^"]*")\s*s--\s*>s	]\s*]\s*>s]\s*>t
ParserBasecBseZdZdZdZdZdZdZdZdZ	dd	Z
dd
ZdZdZ
d
ZdZdZdZdZRS(siParser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers.cCs"|jtkrtdndS(Ns(markupbase.ParserBase must be subclassed(t	__class__RtRuntimeError(tself((s&/usr/local/lib/python2.7/markupbase.pyt__init__scCstddS(Ns.subclasses of ParserBase must override error()(tNotImplementedError(Rtmessage((s&/usr/local/lib/python2.7/markupbase.pyterror!scCsd|_d|_dS(Nii(tlinenotoffset(R((s&/usr/local/lib/python2.7/markupbase.pytreset%s	cCs|j|jfS(s&Return current line number and offset.(RR	(R((s&/usr/local/lib/python2.7/markupbase.pytgetpos)scCs||kr|S|j}|jd||}|rm|j||_|jd||}||d|_n|j|||_|S(Ns
i(trawdatatcountRtrindexR	(RtitjRtnlinestpos((s&/usr/local/lib/python2.7/markupbase.pyt	updatepos1s	tc
Cse|j}|d}|||!dks2td|||d!dkrQ|dS|||d!dkrldSt|}|||d!d	kr|j|S||d
kr|j|S|j||\}}|dkr|S|dkrd|_nxe||kr`||}|dkr`||d|!}|dkrK|j|n
|j||dS|d
krt	||}|sdS|j
}n|dkr|j||\}	}n||jkr|d}nv|d
kr8|dkr|j|d|}qM|dkr(|jd|qM|jdn|jd|||dkr|SqWdS(Nis<!s$unexpected call to parse_declarationit>t-Ris--t[itdoctypes"'t4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZtattlisttlinktypetlinktelements&unsupported '[' char in %s declarations"unexpected '[' char in declarations!unexpected %r char in declaration(RR(RRRR(
RtAssertionErrortlent
parse_commenttparse_marked_sectiont
_scan_namet_decl_othercharsthandle_decltunknown_declt_declstringlit_matchtendt_parse_doctype_subsetR(
RRRRtntdecltypetctdatatmtname((s&/usr/local/lib/python2.7/markupbase.pytparse_declarationAsZ	





icCs|j}|||d!dks,td|j|d|\}}|dkrX|S|dkr}tj||d}nA|dkrtj||d}n|jd
||d|!|sdS|r|jd}|j||d|!n|j	dS(Nis<![s)unexpected call to parse_marked_section()ittemptcdatatignoretincludetrcdatatiftelsetendifs+unknown status keyword %r in marked sectioni(R0R1R2R3R4(R5R6R7(
RRR"t_markedsectionclosetsearcht_msmarkedsectioncloseRtstartR%R'(RRtreportRtsectNameRtmatch((s&/usr/local/lib/python2.7/markupbase.pyR!s 	#cCs|j}|||d!dkr0|jdntj||d}|sPdS|r|jd}|j||d|!n|jdS(Nis<!--s"unexpected call to parse_comment()ii(RRt
_commentcloseR9R;thandle_commentR'(RRR<RR>R((s&/usr/local/lib/python2.7/markupbase.pyR s	c
Cs|j}t|}|}x||kr||}|dkr|||d!}|dkradS|dkr|j||d|jd|n|d|krdS|d|krdS|||d!dkr|j|d	d
}|d
kr|Sqn|j|d|\}}|dkr+dS|dkr_|j||d|jd|nt|d|}	|	||}|d
kr|Sq|dkr|d|krdS|j|d|\}}|d
kr|S||dkr|d}qq|dkr|d}x*||krB||jrB|d}qW||kr||dkrc|S|j|||jdqdSq|jr|d}q|j|||jd|qWdS(Nt<iis<!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(RRRBRC(RRRRR R"tgetattrtisspace(
RRtdeclstartposRR)RR+tsR.tmeth((s&/usr/local/lib/python2.7/markupbase.pyR(sn	


cCsY|j||\}}|dkr(dS|j}d||krU|jd|dSdS(NiRi(R"Rtfind(RRRJR.RR((s&/usr/local/lib/python2.7/markupbase.pyt_parse_doctype_elements	cCs|j}|j||\}}|||d!}|dkrBdS|dkrV|dSx|j||\}}|dkr|S|||d!}|dkrdS|dkrd||kr|jd|d}ndSx%|||d!jr|d}qW||s,dSn|j||\}}|||d!}|sGdS|dkrt||}|rw|j}ndS|||d!}|sdSn|d	kr||d	krdS|j|d|\}}|dkr|S|||d!}|sdSn|dkrY|dSqYWdS(
NiRiRit(t)s'"t#(RR"RMRIR&R'(RRRJRR.RR+R-((s&/usr/local/lib/python2.7/markupbase.pyt_parse_doctype_attlistsZ	
cCs|j||\}}|dkr(|S|j}x|||d!}|sOdS|dkrc|dS|dkrt||}|sdS|j}q4|j||\}}|dkr4|Sq4WdS(NiiiRs'"(R"RR&R'(RRRJR.RRR+R-((s&/usr/local/lib/python2.7/markupbase.pyt_parse_doctype_notation>s$	cCs3|j}|||d!dkri|d}xB|||d!}|sHdS|jra|d}q-Pq-Wn|}|j||\}}|dkr|Sx|j||d!}|sdS|dkrt||}|r|j}q+dSq|dkr|dS|j||\}}|dkr|SqWdS(NiREiis'"R(RRIR"R&R'(RRRJRRR+R.R-((s&/usr/local/lib/python2.7/markupbase.pyt_parse_doctype_entityUs8	

cCs|j}t|}||kr%dSt||}|r|j}|j}|t||krldS|j|jfS|j|||j	d|||d!dS(Nisexpected name token at %ri(Ni(Ni(
RRtNonet_declname_matchtgrouptstriptlowerR'RR(RRRJRR)R-RKR.((s&/usr/local/lib/python2.7/markupbase.pyR"ys		cCsdS(N((RR,((s&/usr/local/lib/python2.7/markupbase.pyR%s(t__name__t
__module__t__doc__RRR
RRR#R/R!R R(RNRRRSRTR"R%(((s&/usr/local/lib/python2.7/markupbase.pyRs"					
	R	C		9		$	((
R\tretcompileR>RVR&R?R8R:R(((s&/usr/local/lib/python2.7/markupbase.pyt<module>s

Zerion Mini Shell 1.0