[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.12.150.240: ~ $
�
0=gc@smdZdZdZddlZddlZejddkr{eje�dZeefZ	ej
d�dZd	�ZneZ	d
�Zddl
TddlmZmZdd
lmZmZmZmZmZmZmZmZmZmZyddlZWn+ek
r-edej�d��nXdej fd��YZ dej!fd��YZ"d�Z#dS(s� A SAX2 driver for libxml2, on top of it's XmlReader API

USAGE
    # put this file (drv_libxml2.py) in PYTHONPATH
    import xml.sax
    reader = xml.sax.make_parser(["drv_libxml2"])
    # ...and the rest is standard python sax.

CAVEATS
    - Lexical handlers are supported, except for start/endEntity
      (waiting for XmlReader.ResolveEntity) and start/endDTD
    - Error callbacks are not exactly synchronous, they tend
      to be invoked before the corresponding content callback,
      because the underlying reader interface parses
      data by chunks of 512 bytes
    
TODO
    - search for TODO
    - some ErrorHandler events (warning)
    - some ContentHandler events (setDocumentLocator, skippedEntity)
    - EntityResolver (using libxml2.?)
    - DTDHandler (if/when libxml2 exposes such node types)
    - DeclHandler (if/when libxml2 exposes such node types)
    - property_xml_string?
    - feature_string_interning?
    - Incremental parser
    - additional performance tuning:
      - one might cache callbacks to avoid some name lookups
      - one might implement a smarter way to pass attributes to startElement
        (some kind of lazy evaluation?)
      - there might be room for improvement in start/endPrefixMapping
      - other?

sSt�phane Bidoul <sbi@skynet.be>s0.3i����Niitutf8icCs"|dkr|St|�dSdS(Ni(tNonet_decoder(ts((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt_d1scCs|S(N((R((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyR9s(t*(t	xmlreadertsaxutils(
tfeature_namespacestfeature_namespace_prefixestfeature_string_interningtfeature_validationtfeature_external_gestfeature_external_pestproperty_lexical_handlertproperty_declaration_handlertproperty_dom_nodetproperty_xml_strings+libxml2 not available: import error was: %stLocatorcBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(s4SAX Locator adapter for libxml2.xmlTextReaderLocatorcCs
||_dS(N(t_Locator__locator(tselftlocator((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt__init__SscCsdS(s6Return the column number where the current event ends.i����((R((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pytgetColumnNumberVscCs
|jj�S(s4Return the line number where the current event ends.(Rt
LineNumber(R((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt
getLineNumberZscCsdS(s3Return the public identifier for the current event.N(R(R((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pytgetPublicId^scCs
|jj�S(s3Return the system identifier for the current event.(RtBaseURI(R((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pytgetSystemIdbs(t__name__t
__module__t__doc__RRRRR(((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyRPs				t
LibXml2ReadercBsbeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
cCs\tjj|�d|_d|_d|_d|_d|_d|_	d|_
d|_dS(Nii(Rt	XMLReaderRt_LibXml2Reader__nst_LibXml2Reader__nspfxt_LibXml2Reader__validatet_LibXml2Reader__extparamst_LibXml2Reader__parsingRt_LibXml2Reader__lex_handlert_LibXml2Reader__decl_handlert_LibXml2Reader__errors(R((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyRhs							cCsG|jdkrg|_n|jj|t|dt|��f�dS(N(R)RtappendtSAXParseExceptionR(RtargtmsgtseverityR((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt
_errorHandlerws
	cCs�x�|jD]w\}}|tjtjfkrA|jj|�q
|rq||jddkrq|jj|�q
|jj|�q
Wd|_dS(Ni����i(	R)tlibxml2t PARSER_SEVERITY_VALIDITY_WARNINGtPARSER_SEVERITY_WARNINGt_err_handlertwarningt
fatalErrorterrorR(RtfatalR.t	exception((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt
_reportErrors~s	cCsCd|_z)t|t�r-tj|�}nZtj|�}|j�}|dkrc|j	�}ntj
|�}|j|j��}|j
|jd�|jr�|jtjd�|jtjd�|jtjd�|jtj|j�n|jtjd�|jr&tjii�}ntji�}g}|jj�x�|j�}|dkr�|jdk	r�|jd�q�ne|dkr�|jdk	r�|jd�nPn6|jdk	r�|jd�n|jj t!d��P|j"�}	|	dkrB|jr�t#|j$��t#|j%��f}
t#|j&��}i|_'}i|_(}
g}x�|j)�r5t#|j&��}t#|j*��}|j+d�r�t,|�dkr�|d}nd}|j-|�|jj.||�|j/s�qdq�nt#|j$��t#|j%��f}||
|<|||<qdW|j0�|jj1|
||�|j2�r�|jj3|
|�x.|D]}|jj4|�q|Wq?|j-|�qt#|j&��}
i|_'}x8|j)�rt#|j&��}t#|j*��||<q�W|j0�|jj5|
|�|j2�r|jj6|
�qqK|	dkr�|jr�|jj3t#|j$��t#|j%��ft#|j&���xC|j7�D]}|jj4|�q�Wq|jj6t#|j&���qK|	dkr|jj8t#|j*���qK|	d	kr3|jj9t#|j*���qK|	d
kr^|jj8t#|j*���qK|	dkr�|j:dk	r�|j:j;�n|jj8t#|j*���|j:dk	r|j:j<�qqK|	dkr|j:dk	r�|j=t#|j&���n|j>�qK|	dkrE|j:dk	r|j?t#|j&���qqK|	d
kr|jj@t#|j&��t#|j*���qK|	dkr�|j:dk	r|j:jAt#|j*���qqK|	dkr�qK|	dkr�qK|	dkr�qK|	dkr�qKt!d|	��qK|dkr'|jjB�n|jC�Wdd|_XdS(Niis"Read failed (no details available)txmlnsiiiii
iiiiii
iisUnexpected node type %d(DR&t
isinstancetStringTypesR0tnewTextReaderFilenameRtprepare_input_sourcetgetCharacterStreamRt
getByteStreamtinputBuffert
newTextReaderRtSetErrorHandlerR/R%t
SetParserProptPARSER_LOADDTDtPARSER_DEFAULTATTRStPARSER_SUBST_ENTITIEStPARSER_VALIDATER$R"RtAttributesNSImpltAttributesImplt
_cont_handlert
startDocumenttReadR)R9R3R5tSAXExceptiontNodeTypeRtNamespaceUrit	LocalNametNamet_attrst_qnamestMoveToNextAttributetValuet
startswithtlenR*tstartPrefixMappingR#t
MoveToElementtstartElementNStIsEmptyElementtendElementNStendPrefixMappingtstartElementt
endElementtpopt
characterstignorableWhitespaceR't
startCDATAtendCDATAtstartEntityt
ResolveEntityt	endEntitytprocessingInstructiontcommenttendDocumenttClose(RtsourcetreadertstreamtinputtattributesNSImpltattributesImpltprefixestrtnodeTypeteltNameteltQNametattrstqnamestnewPrefixestqnametvaluet	newPrefixtattNametprefix((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pytparse�s�			
	
	



	
		

	



	
		!
	%"cCstd��dS(NsDTDHandler not supported(tSAXNotSupportedException(Rthandler((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt
setDTDHandler;scCstd��dS(NsEntityResolver not supported(R�(Rtresolver((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pytsetEntityResolver?scCsp|tkr|jS|tkr&|jS|tkr9|jS|tkrIdS|tkr\|jSt	d|��dS(NisFeature '%s' not recognized(
RR"R	R#RR$RR
R%tSAXNotRecognizedException(Rtname((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt
getFeatureCscCs�|jrtd|��n|tkr4||_n�|tkrL||_nn|tkrd||_nV|tkr�|dkr�td|��q�n(|t	kr�||_
ntd|��dS(Ns#Cannot set feature %s while parsingisFeature '%s' not supportedsFeature '%s' not recognized(R&R�RR"R	R#RR$RR
R%R�(RR�tstate((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt
setFeatureRs"	
cCs:|tkr|jS|tkr&|jStd|��dS(NsProperty '%s' not recognized(RR'RR(R�(RR�((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pytgetPropertygscCsT|tkr||_n8|tkr@td|��||_ntd|��dS(NsProperty '%s' not supportedsProperty '%s' not recognized(RR'RR�R(R�(RR�R|((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pytsetPropertyps
(RRRR/R9R�R�R�R�R�R�R�(((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyR fs				�						cCst�S(N(R (((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt
create_parser|s($Rt
__author__t__version__tsystcodecstversion_infotunicode_escape_decodetstrtunicodeR<tlookupRRtxml.sax._exceptionstxml.saxRRtxml.sax.handlerRR	R
RRR
RRRRR0tImportErrortSAXReaderNotAvailabletexc_infoRR!R R�(((sA/opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt<module>#s.	
F
�

Filemanager

Name Type Size Permission Actions
drv_libxml2.py File 15.02 KB 0644
drv_libxml2.pyc File 11.56 KB 0644
drv_libxml2.pyo File 11.56 KB 0644
libxml2.py File 354.59 KB 0644
libxml2.pyc File 473.89 KB 0644
libxml2.pyo File 473.89 KB 0644