File "parser.cpython-34.pyo"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib64/python3.4/html/__pycache__/parser.cpython-34.pyo
File size: 14.38 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


h fS@sldZddlZddlZddlZddlmZdgZejdZejdZ	ejdZ
ejdZejd	Zejd
Z
ejdZejdZejd
ZejdZejdZejdejZejdejZejd
ZejdZGdddeZeZGdddejZdS)zA parser for HTML and XHTML.N)unescape
HTMLParserz[&<]z
&[a-zA-Z#]z%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]z)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]z	<[a-zA-Z]>z--\s*>z(([a-zA-Z][-.a-zA-Z0-9:_]*)(?:\s|/(?!>))*z$([a-zA-Z][^	

 />]*)(?:\s|/(?!>))*zJ\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*(\'[^\']*\'|"[^"]*"|[^\s"\'=<>`]*))?z]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*a
  <[a-zA-Z][-.a-zA-Z0-9:_]*          # tag name
  (?:\s+                             # whitespace before attribute name
    (?:[a-zA-Z_][-.:a-zA-Z0-9_]*     # attribute name
      (?:\s*=\s*                     # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |\"[^\"]*\"                # LIT-enclosed value
          |[^'\">\s]+                # bare value
         )
       )?
     )
   )*
  \s*                                # trailing whitespace
aF
  <[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*,)*                   # possibly followed by a comma
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
z#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>c@s1eZdZdZdddZddZdS)HTMLParseErrorz&Exception raised for all parse errors.NcCs'||_|d|_|d|_dS)Nr)msglinenooffset)selfrZpositionr0/opt/alt/python34/lib64/python3.4/html/parser.py__init__Us	
zHTMLParseError.__init__cCsW|j}|jdk	r,|d|j}n|jdk	rS|d|jd}n|S)Nz, at line %dz, column %dr)rrr	)r
resultrrr__str__[s	zHTMLParseError.__str__)NN)__name__
__module____qualname____doc__r
rrrrrrRsrc@sfeZdZdZd;ZededdZddZd	d
ZddZ	d
dZ
dZddZddZ
ddZddZddZdddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Z dS)<raEFind 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).  If convert_charrefs is
    True the character references are converted automatically to the
    corresponding Unicode character (and self.handle_data() is no
    longer split in chunks), otherwise they are passed by calling
    self.handle_entityref() or self.handle_charref() with the string
    containing respectively the named or numeric reference as the
    argument.
    scriptstyleconvert_charrefscCsv|tk	r%tjdtddnd}||_|tkr_d}tjdtddn||_|jdS)aInitialize and reset this instance.

        If convert_charrefs is True (default: False), all character references
        are automatically converted to the corresponding Unicode characters.
        If strict is set to False (the default) the parser will parse invalid
        markup, otherwise it will raise an error.  Note that the strict mode
        and argument are deprecated.
        z,The strict argument and mode are deprecated.
stacklevelFzfThe value of convert_charrefs will become True in 3.5. You are encouraged to set the value explicitly.N)_default_sentinelwarningswarnDeprecationWarningstrictrreset)r
rrrrrr
~s
				zHTMLParser.__init__cCs8d|_d|_t|_d|_tjj|dS)z1Reset this instance.  Loses all unprocessed data.z???N)rawdatalasttaginteresting_normalinteresting
cdata_elem_markupbase
ParserBaser)r
rrrrs
				zHTMLParser.resetcCs!|j||_|jddS)zFeed data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '\n').
        rN)r goahead)r
datarrrfeedszHTMLParser.feedcCs|jddS)zHandle any buffered data.rN)r')r
rrrcloseszHTMLParser.closecCs/tjdtddt||jdS)Nz!The 'error' method is deprecated.rr)rrrrgetpos)r
messagerrrerrors	
zHTMLParser.errorNcCs|jS)z)Return full source of start tag: '<...>'.)_HTMLParser__starttag_text)r
rrrget_starttag_textszHTMLParser.get_starttag_textcCs2|j|_tjd|jtj|_dS)Nz</\s*%s\s*>)lowerr$recompileIr#)r
elemrrrset_cdata_modeszHTMLParser.set_cdata_modecCst|_d|_dS)N)r"r#r$)r
rrrclear_cdata_modes	zHTMLParser.clear_cdata_modecCs#|j}d}t|}xs||kr|jr|jr|jd|}|dkr|jdt||d}|dkrtjdj	||rPn|}qn=|j
j	||}|r|j}n|jrPn|}||krH|jr.|jr.|jt
|||qH|j|||n|j||}||krjPn|j}|d|r_tj||r|j|}	n|d|r|j|}	n|d|r|j|}	n|d|r	|j|}	ng|d	|rE|jr3|j|}	qp|j|}	n+|d
|kro|jd|d
}	nP|	dkrJ|sPn|jr|jdn|jd|d
}	|	dkr|jd|d
}	|	dkr|d
}	qn
|	d
7}	|jr0|jr0|jt
|||	qJ|j|||	n|j||	}q|d
|r;tj||}|r|jdd}
|j|
|j}	|d|	d
s|	d
}	n|j||	}qqd||dkr7|j|||d|j||d}nPq|d|rtj||}|r|jd
}
|j|
|j}	|d|	d
s|	d
}	n|j||	}qnt j||}|rS|rO|j||dkrO|jr|jdqO|j}	|	|kr6|}	n|j||d
}nPq|d
|kr|jd|j||d
}qPqqW|r||kr|jr|jr|jr|jt
|||n|j||||j||}n||d|_dS)Nr<&"z[\s;]z</z<!--z<?z<!rzEOF in middle of constructrz&#r;z#EOF in middle of entity or char ref)!r lenrr$findrfindmaxr1r2searchr#starthandle_datar	updatepos
startswithstarttagopenmatchparse_starttagparse_endtag
parse_commentparse_pirZparse_declarationparse_html_declarationr-charrefgrouphandle_charrefend	entityrefhandle_entityref
incomplete)r
rOr injZampposrFrDknamerrrr's		 		

	
 



"		
 zHTMLParser.goaheadcCs|j}|||ddkr0|j|S|||ddkrW|j|S|||djdkr|jd|d}|d
krdS|j||d	||dS|j|SdS)Nz<!--z<![	z	<!doctyperrrr;r;)r rIZparse_marked_sectionr0r=handle_declparse_bogus_comment)r
rSr gtposrrrrKCs	

 z!HTMLParser.parse_html_declarationrcCs[|j}|jd|d}|dkr/dS|rS|j||d|n|dS)Nrrrr;r;)r r=handle_comment)r
rSZreportr posrrrr\Xs	zHTMLParser.parse_bogus_commentcCs`|j}tj||d}|s)dS|j}|j||d||j}|S)Nrrr;)r picloser@rA	handle_pirO)r
rSr rFrUrrrrJds	zHTMLParser.parse_picCsd|_|j|}|dkr(|S|j}||||_g}|jrltj||d}ntj||d}|j}|jdj	|_
}x$||kr|jrtj||}ntj||}|sPn|jddd\}	}
}|
s d}ns|dddkoK|ddkns|dddko{|d
dknr|dd}n|rt
|}n|j|	j	|f|j}qW|||j}|dkr|j\}
}d	|jkrL|
|jjd	}
t|j|jjd	}n|t|j}|jr|jd
|||ddfn|j||||S|jdr|j||n/|j||||jkr|j|n|S)NrrrrY'"r/>
z junk characters in start tag: %rr;r;r;)rrd)r.check_for_whole_start_tagr rtagfindrFtagfind_tolerantrOrMr0r!attrfindattrfind_tolerantrappendstripr+countr<r>r-rBendswithhandle_startendtaghandle_starttagCDATA_CONTENT_ELEMENTSr5)r
rSendposr attrsrFrVtagmZattrnamerestZ	attrvaluerOrr	rrrrGps^					00		"zHTMLParser.parse_starttagcCsk|j}|jr'tj||}ntj||}|r[|j}|||d}|dkrs|dS|dkr|jd|r|dS|jd|rdS|jr|j||d|jdn||kr|S|dSn|dkrdS|dkrd
S|jr@|j|||jd	n||krP|S|dSnt	d
dS)Nrr/z/>rzmalformed empty start tagrz6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzmalformed start tagzwe should not get here!r;r;r;)
r rlocatestarttagendrFlocatestarttagend_tolerantrOrDrCr-AssertionError)r
rSr rvrUnextrrrrgs>				z$HTMLParser.check_for_whole_start_tagcCs|j}tj||d}|s)dS|j}tj||}|s1|jdk	rw|j||||S|jr|j	d|||fnt
j||d}|s|||ddkr|dS|j|Sn|jdj
}|jd|j}|j||dS|jdj
}|jdk	r||jkr|j||||Sn|j|j
|j|S)Nrzbad end tag: %rrrYz</>rr;)r 	endendtagr@rO
endtagfindrFr$rBrr-rir\rMr0r=
handle_endtagr6)r
rSr rFr]Z	namematchZtagnamer4rrrrHs:		!

zHTMLParser.parse_endtagcCs!|j|||j|dS)N)rqr)r
rurtrrrrpszHTMLParser.handle_startendtagcCsdS)Nr)r
rurtrrrrqszHTMLParser.handle_starttagcCsdS)Nr)r
rurrrr
szHTMLParser.handle_endtagcCsdS)Nr)r
rWrrrrNszHTMLParser.handle_charrefcCsdS)Nr)r
rWrrrrQszHTMLParser.handle_entityrefcCsdS)Nr)r
r(rrrrBszHTMLParser.handle_datacCsdS)Nr)r
r(rrrr^szHTMLParser.handle_commentcCsdS)Nr)r
Zdeclrrrr[szHTMLParser.handle_declcCsdS)Nr)r
r(rrrra"szHTMLParser.handle_picCs$|jr |jd|fndS)Nzunknown declaration: %r)rr-)r
r(rrrunknown_decl%s	zHTMLParser.unknown_declcCs tjdtddt|S)NzZThe unescape method is deprecated and will be removed in 3.5, use html.unescape() instead.rr)rrrr)r
srrrr*s	
zHTMLParser.unescape)rr)!rrrrrrrr
rr)r*r-r.r/r5r6r'rKr\rJrGrgrHrprqrrNrQrBr^r[rarrrrrrrfs<	<+*)rr1rr%Zhtmlr__all__r2r"rRrPrLrEr`ZcommentcloserhrirjrkVERBOSEryrzr}r~	Exceptionrobjectrr&rrrrr<module>s6