https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/__pycache__/drv_libxml2.cpython-310.pyc
o

=�h<�@sdZdZdZddlZddlZejddkr,e�e�dZeefZ	e�
d�dZdd	�ZneZ	d
d	�Zddl
TddlmZmZdd
lmZmZmZmZmZmZmZmZmZmZzddlZWneymede��d��wGdd�dej �Z Gdd�dej!�Z"dd�Z#dS)a� 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?

u Stéphane Bidoul <sbi@skynet.be>z0.3�N��utf8�cCs|dur|St|�dS)Nr)�_decoder��s�r�-/usr/lib/python3/dist-packages/drv_libxml2.py�_d1sr
cCs|S�Nrrrrr	r
9s)�*)�	xmlreader�saxutils)
�feature_namespaces�feature_namespace_prefixes�feature_string_interning�feature_validation�feature_external_ges�feature_external_pes�property_lexical_handler�property_declaration_handler�property_dom_node�property_xml_stringz+libxml2 not available: import error was: %sc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�Locatorz4SAX Locator adapter for libxml2.xmlTextReaderLocatorcCs
||_dSr)�_Locator__locator)�self�locatorrrr	�__init__Ss
zLocator.__init__cC�dS)z6Return the column number where the current event ends.���r�rrrr	�getColumnNumberV�zLocator.getColumnNumbercC�
|j��S)z4Return the line number where the current event ends.)r�
LineNumberr rrr	�
getLineNumberZ�
zLocator.getLineNumbercCr)z3Return the public identifier for the current event.Nrr rrr	�getPublicId^r"zLocator.getPublicIdcCr#)z3Return the system identifier for the current event.)r�BaseURIr rrr	�getSystemIdbr&zLocator.getSystemIdN)	�__name__�
__module__�__qualname__�__doc__rr!r%r'r)rrrr	rPsrc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�
LibXml2ReadercCs@tj�|�d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nrr)r
�	XMLReaderr�_LibXml2Reader__ns�_LibXml2Reader__nspfx�_LibXml2Reader__validate�_LibXml2Reader__extparams�_LibXml2Reader__parsing�_LibXml2Reader__lex_handler�_LibXml2Reader__decl_handler�_LibXml2Reader__errorsr rrr	rhs
zLibXml2Reader.__init__cCs0|jdurg|_|j�|t|dt|��f�dSr)r7�append�SAXParseExceptionr)r�arg�msg�severityrrrr	�
_errorHandlerws
�
�zLibXml2Reader._errorHandlercCsh|jD]+\}}|tjtjfvr|j�|�q|r(||jddur(|j�|�q|j�|�qd|_dS)Nrr)r7�libxml2� PARSER_SEVERITY_VALIDITY_WARNING�PARSER_SEVERITY_WARNING�_err_handler�warning�
fatalError�error)r�fatalr<�	exceptionrrr	�
_reportErrors~s�
zLibXml2Reader._reportErrorscCsVd|_�z�t|t�rt�|�}nt�|�}|��}|dur!|��}t�	|�}|�
|���}|�|j
d�|jrU|�tjd�|�tjd�|�tjd�|�tj|j�n|�tjd�|jrft�ii�}nt�i�}g}|j��	|��}|dkr�|jdur�|�d�n%|dkr�|jdur�|�d��n�|jdur�|�d�n|j�t d���n�|�!�}	|	dk�r�|j�rRt"|�#��t"|�$��f}
t"|�%��}i|_&}i|_'}
g}|�(��r%t"|�%��}t"|�)��}|�*d��r
t+|�dkr�|dd�}nd}|�,|�|j�-||�|j.�s
q�t"|�#��t"|�$��f}||
|<|||<|�(�s�|�/�|j�0|
||�|�1��rK|j�2|
|�|D]	}|j�3|��q?�nG|�,|��n@t"|�%��}
i|_&}|�(��rut"|�%��}t"|�)��||<|�(��sb|�/�|j�4|
|�|�1��r�|j�5|
��n|	dk�r�|j�r�|j�2t"|�#��t"|�$��ft"|�%���|�6�D]	}|j�3|��q�n�|j�5t"|�%���n�|	dk�r�|j�7t"|�)���n�|	d	k�r�|j�8t"|�)���n�|	d
k�r�|j�7t"|�)���n�|	dk�r|j9du�r|j9�:�|j�7t"|�)���|j9du�r|j9�;�nw|	dk�r4|j9du�r/|�<t"|�%���|�=�n^|	dk�rI|j9du�rH|�>t"|�%���nI|	d
k�r^|j�?t"|�%��t"|�)���n4|	dk�rt|j9du�rs|j9�@t"|�)���n|	dk�rzn|	dk�r�n|	dk�r�n|	dk�r�nt d|	��qs|dk�r�|j�A�|�B�Wd|_dSd|_w)Nrrz"Read failed (no details available)�xmlns���r�
������
��zUnexpected node type %d)Cr4�
isinstance�StringTypesr>�newTextReaderFilenamer�prepare_input_source�getCharacterStream�
getByteStream�inputBuffer�
newTextReaderr)�SetErrorHandlerr=r3�
SetParserProp�PARSER_LOADDTD�PARSER_DEFAULTATTRS�PARSER_SUBST_ENTITIES�PARSER_VALIDATEr2r0r
�AttributesNSImpl�AttributesImpl�
_cont_handler�
startDocument�Readr7rGrArC�SAXException�NodeTyper
�NamespaceUri�	LocalName�Name�_attrs�_qnames�MoveToNextAttribute�Value�
startswith�lenr8�startPrefixMappingr1�
MoveToElement�startElementNS�IsEmptyElement�endElementNS�endPrefixMapping�startElement�
endElement�pop�
characters�ignorableWhitespacer5�
startCDATA�endCDATA�startEntity�
ResolveEntity�	endEntity�processingInstruction�comment�endDocument�Close)r�source�reader�stream�input�attributesNSImpl�attributesImpl�prefixes�r�nodeType�eltName�eltQName�attrs�qnames�newPrefixes�qname�value�	newPrefix�attName�prefixrrr	�parse�s"






�


�


�



�

���
�


��
�

��





�


�
�
�



��



zLibXml2Reader.parsecC�td��)NzDTDHandler not supported��SAXNotSupportedException)r�handlerrrr	�
setDTDHandler;�zLibXml2Reader.setDTDHandlercCr�)NzEntityResolver not supportedr�)r�resolverrrr	�setEntityResolver?r�zLibXml2Reader.setEntityResolvercCsP|tkr|jS|tkr|jS|tkr|jS|tkrdS|tkr"|jSt	d|��)Nr�Feature '%s' not recognized)
rr0rr1rr2rrr3�SAXNotRecognizedException�r�namerrr	�
getFeatureCs�zLibXml2Reader.getFeaturecCs�|jr	td|��|tkr||_dS|tkr||_dS|tkr$||_dS|tkr4|dkr2td|��dS|t	kr=||_
dStd|��)Nz#Cannot set feature %s while parsingrzFeature '%s' not supportedr�)r4r�rr0rr1rr2rrr3r�)rr��staterrr	�
setFeatureRs*�


��
�zLibXml2Reader.setFeaturecCs(|tkr|jS|tkr|jStd|��)N�Property '%s' not recognized)rr5rr6r�r�rrr	�getPropertygs�zLibXml2Reader.getPropertycCs2|tkr	||_dS|tkrtd|��td|��)NzProperty '%s' not supportedr�)rr5rr�r6r�)rr�r�rrr	�setPropertyps
��zLibXml2Reader.setPropertyN)
r*r+r,rr=rGr�r�r�r�r�r�r�rrrr	r.fs/	r.cCst�Sr)r.rrrr	�
create_parser|sr�)$r-�
__author__�__version__�sys�codecs�version_info�unicode_escape_decode�str�unicoderV�lookuprr
�xml.sax._exceptions�xml.saxr
r�xml.sax.handlerrrrrrrrrrrr>�ImportError�SAXReaderNotAvailable�exc_inforr/r.r�rrrr	�<module>s6#
0
��

https://t.me/RX1948 - 2025