403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/html5lib/treebuilders/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/html5lib/treebuilders/__pycache__/etree_lxml.cpython-312.pyc
�

V=�^�9��~�dZddlmZmZmZddlZddlZddlZ	ddlm	Z	ddlm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZddlmZmZd
Zej0d�Zej4d�j6ZGd�de�ZGd�de�Zd�Z d�Z!Gd�de
jD�Z"y#e
$r	ddlm	Z	Y��wxYw)a�Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause problems:

Text or comments as siblings of the root element
Docypes with no name

When any of these things occur, we emit a DataLossWarning
�)�absolute_import�division�unicode_literalsN)�MutableMapping�)�base�)�DataLossWarning)�	constants)�etree)�	_ihatexml)�PY3�binary_typeTz
{([^}]*)}(.*)�asdc��eZdZd�Zy)�DocumentTypec�.�||_||_||_y�N)�name�publicId�systemId)�selfrrrs    �B/usr/lib/python3/dist-packages/html5lib/treebuilders/etree_lxml.py�__init__zDocumentType.__init__)s����	� ��
� ��
�N)�__name__�
__module__�__qualname__r�rrrr(s��!rrc�.�eZdZd�Zd�Zd�Zee�Zy)�Documentc� �d|_g|_yr)�_elementTree�_childNodes�rs rrzDocument.__init__0s�� �����rc���|jj�}|jj�j�D]}�|j|j�yr)r#�getroot�itersiblings�addnext�_element)r�element�lasts   r�appendChildzDocument.appendChild4sT��� � �(�(�*���%�%�-�-�/�<�<�>�	�D��	�	
���W�%�%�&rc��|jSr)r$r%s r�_getChildNodeszDocument._getChildNodes;s�����rN)rrrrr-r/�property�
childNodesrrrr!r!/s���'� ��.�)�Jrr!c�|����g�tjd���d���fd�	��|d�dj��S)NT��preventDoubleDashCommentsrc
�2	��t|d��s�t|d��r4�jd�|jjr�|jjs0|jj
sd|jjz}nHd|jj�d|jj�d|jj
�d�}�jd	d
|dzz�|���|j�}|j��!|j�}|j���!|���||dz�|j�}|��yt|t�st|t�rDt|t�stjddk(sJ��jd	d
|z�d
|�d
��y�jd�|D]}�||dz��yy|jt k(re�jd	d
|z�d|j"�d��t|d�r3|j$r&�jd	d
|z�d
|j$�d
��yyyt|t&j(�sJ�t*j,j/|j�}|�c|j1d�}|j1d�}t2j4|}�jd	d
|z�d|�d
�
j7|��d��n4�jd	d
|z�d�
j7|j��d��t|d�r�g}|j8j;�D]\}	}
t,j/|	�}|�?|j=�\}}	�
j7|	�}	t2j4|}|�d
|	��}n�
j7|	�}|j||
f���t?|�D]%\}	}
�jd	d
|dzz�|	�d|
�d
���'|j"r(�jd	d
|dzz�d
|j"�d
��|dz
}|D]}�||��
t|d�r6|j$r)�jd	d
|dz
z�d
|j$�d
��yyy)N�tagr'z	#document�
<!DOCTYPE %s>z
<!DOCTYPE z "z" "z">�|� r	r�"z#document-fragmentz<!-- z -->�tailr�<�>�attrib�=") �hasattr�append�docinfo�internalDTD�	public_id�
system_url�	root_namer'�getprevious�getnext�
isinstance�str�bytes�sys�version_infor6�comment_type�textr;r�_Element�etree_builders�
tag_regexp�match�groupr�prefixes�fromXmlNamer>�items�groups�sorted)r+�indent�dtd_str�next_element�nsmatch�nsr6�prefix�
attributesr�value�attr_string�child�
infosetFilter�rv�serializeElements             ���rrfz(testSerializer.<locals>.serializeElementEs�����w��&��w�	�*��	�	�+�&��?�?�.�.�#�O�O�5�5�#�O�O�6�6�"1�G�O�O�4M�4M�"M���$�O�O�5�5�#�O�O�5�5�#�O�O�6�6�#8���I�I����
�);�W�E�F�&���0��"�.�.�0�<�#/�#;�#;�#=�L�#�.�.�0�<�"�.�$�\�6�A�:�>�#/�#7�#7�#9�L�#�.��G�S�)�Z���-G�!�'�3�/�3�3C�3C�A�3F�!�3K�K�K��	�	��v��w�?�@��	�	�.�/�$+�?�L�$�\�6�A�:�>�?�/��[�[�L�
(��I�I�#��,����E�F��w��'�G�L�L��	�	��v��w�|�|�D�E�-9�'��g�u�~�~�6�6�6�$�/�/�5�5�g�k�k�B�G��"��]�]�1�%���m�m�A�&��"�+�+�B�/���	�	�#��,��*7�*C�*C�C�*H�J�K��	�	�s�V�|�'4�'@�'@����'M�O�P��w��)��
�#*�>�>�#7�#7�#9�	<�K�D�%�(�.�.�t�4�G��*�#*�>�>�#3���D�,�8�8��>��!*�!3�!3�B�!7��17��&>��&3�&?�&?��&E���%�%�{�E�&:�;�	<�$*�*�#5�P�K�D�%��I�I�c�V�a�Z�.@�$��N�O�P��|�|��	�	����
�);�W�\�\�J�K��a�K�F� �
0�� ���/�
0��w��'�G�L�L��	�	����
�);�W�\�\�J�K�-9�'r�
)r)r
�
InfosetFilter�join)r+rdrerfs @@@r�testSerializerrjAs:���	�B��+�+�d�K�M�EL�L�W�a� ��9�9�R�=�rc�H���g���fd���|�dj��S)z4Serialize an element and its child nodes to a stringc
����t|d�s�|jjrW|jjr|jj}nd|jjz}�j|��|j
���n|jtk(r �jd|j�d��n�|js �jd|j�d��nddj|jj�D��cgc]
\}}|�d|�d	���c}}�}�jd|j�d|�d��|jr�j|j�|D]
}�|���jd
|j�d��t|d�r)|jr�j|j�yyycc}}w)Nr6r7z<!--z-->r<r=r9r?r:z</r;)r@rBrC�doctyperFrAr'r6rNrOr>rirWr;)r+r[rra�attrrcrerfs      ��rrfz"tostring.<locals>.serializeElement�sc����w��&����*�*��?�?�*�*�%�o�o�5�5�G�-����0I�0I�I�G��	�	�'�"��W�_�_�.�/�
�[�[�L�
(��I�I�W�\�\�3�4��>�>��	�	�G�K�K�1�2��x�x�4;�N�N�4H�4H�4J�!L�%0�T�5�15�e�!<�!L�M���	�	�w�{�{�D�9�:��|�|��	�	�'�,�,�'� �
(�� ��'�
(�
�I�I����.�/��7�F�#�����I�I�g�l�l�#�)5�#��!Ls�G!
�)ri)r+rerfs @@r�tostringrp�s&���	�B�$�@�W��
�7�7�2�;�rc�l��eZdZeZeZdZdZeZ	e
Zdd�Zd�Z
d�Zd�Zd�Zd�Zdd�Zd�fd	�	Zd
�Z�xZS)
�TreeBuilderNc�h����tjt|���tjd��x�|_||_G�fd�dt��G���fd�d�j�}G��fd�d	�j�}||_
||_tjj||�y)
N)�fullTreeTr3c�B��eZdZd�Z�fd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�(TreeBuilder.__init__.<locals>.Attributesc��||_yr)r*�rr+s  rrz1TreeBuilder.__init__.<locals>.Attributes.__init__�s	�� '��
rc���t|t�rd|d�d�j|d���}|S�j|�}|S)N�{r	�}r)rI�tuple�coerceAttribute)r�keyrrds   �r�
_coerceKeyz3TreeBuilder.__init__.<locals>.Attributes._coerceKey�sI����c�5�)�'*�1�v�}�/L�/L�S�QR�V�/T�U�D���)�8�8��=�D��rc��|jjj|j|�}ts!t	|t
�r|j
d�}|S)N�ascii)r*r>rrrIr�decode�rr~ras   r�__getitem__z4TreeBuilder.__init__.<locals>.Attributes.__getitem__�sD���
�
�.�.�5�5�d�o�o�c�6J�K���z�%��=�!�L�L��1�E��rc�h�||jjj|j|�<yr�r*r>rr�s   r�__setitem__z4TreeBuilder.__init__.<locals>.Attributes.__setitem__�s%��FK��
�
�&�&�-�-�d�o�o�c�.B�Crc�d�|jjj|j|�=yrr�)rr~s  r�__delitem__z4TreeBuilder.__init__.<locals>.Attributes.__delitem__�s#���M�M�*�*�1�1�$�/�/�#�2F�Grc�T�t|jjj�Sr)�iterr*r>r%s r�__iter__z1TreeBuilder.__init__.<locals>.Attributes.__iter__�s���D�M�M�2�2�9�9�:�:rc�T�t|jjj�Sr)�lenr*r>r%s r�__len__z0TreeBuilder.__init__.<locals>.Attributes.__len__�s���4�=�=�1�1�8�8�9�9rc�^�|jjjj�Sr)r*r>�clearr%s rr�z.TreeBuilder.__init__.<locals>.Attributes.clear�s!���}�}�-�-�4�4�:�:�<�<rN)rrrrrr�r�r�r�r�r�)rds�r�
Attributesrv�s-���
(�
�
�
L�
H�
;�
:�
=rr�c�t��eZdZ���fd�Z�fd�Z�fd�Zeee�Zd�Zd�Z	eee	�Z
d	��fd�	Zd�Zy)
�%TreeBuilder.__init__.<locals>.Elementc�~���j|�}�jj|||���|�|_y)N)�	namespace)�
coerceElement�Elementr�_attributes)rrr�r��builderrds   ���rrz.TreeBuilder.__init__.<locals>.Element.__init__�s9���$�2�2�4�8�����(�(��t�y�(�I�#-�d�#3�� rc����j|�|_|j|j|j�|j_yr)r��_name�_getETreeTag�
_namespacer*r6)rrrds  �r�_setNamez.TreeBuilder.__init__.<locals>.Element._setName�s9���*�8�8��>��
�$(�$5�$5��J�J����%1��
�
�!rc�:���j|j�Sr)rVr�)rrds �r�_getNamez.TreeBuilder.__init__.<locals>.Element._getName�s���$�0�0����<�<rc��|jSr)r�r%s r�_getAttributesz4TreeBuilder.__init__.<locals>.Element._getAttributes�s���'�'�'rc�^�|j}|j�|j|�yr)r`r��update)rrar`s   r�_setAttributesz4TreeBuilder.__init__.<locals>.Element._setAttributes�s%��!�_�_�
�� � �"��!�!�%�(rNc�b���j|�}�jj|||�yr)�coerceCharactersr��
insertText)r�data�insertBeforer�rds   ��rr�z0TreeBuilder.__init__.<locals>.Element.insertTexts)���$�5�5�d�;�����*�*�4��|�Drc���t|�|j|j�}|jjr9|jjj|jj�|Sr)�typerr�r*r>r�rxs  r�	cloneNodez/TreeBuilder.__init__.<locals>.Element.cloneNodesR��$�$�t�*�T�Y�Y����?���=�=�'�'��$�$�+�+�2�2�4�=�=�3G�3G�H��rr)
rrrrr�r�r0rr�r�r`r�r�)r�r�rds���rr�r��sC���
4�

1�

=��H�h�/�D�
(�
)�
"�.�.�A�J�
E�
rr�c�<��eZdZ��fd�Z�fd�Zd�Zeee�Zy)�%TreeBuilder.__init__.<locals>.Commentc�`���j|�}�jj||�yr)�
coerceComment�Commentr)rr�r�rds  ��rrz.TreeBuilder.__init__.<locals>.Comment.__init__s'���$�2�2�4�8�����(�(��t�4rc�J���j|�}||j_yr)r�r*rO)rr�rds  �r�_setDataz.TreeBuilder.__init__.<locals>.Comment._setDatas���$�2�2�4�8��%)��
�
�"rc�.�|jjSr)r*rOr%s r�_getDataz.TreeBuilder.__init__.<locals>.Comment._getDatas���}�}�)�)�)rN)rrrrr�r�r0r�)r�rds��rr�r�
s ���
5�
*�
*��H�h�/�Drr�)rQ�getETreeModulerr
rhrd�namespaceHTMLElementsrr�r��elementClass�commentClassrrrr)rr�rtr�r�r�r�rds     @@@rrzTreeBuilder.__init__�s���� �/�/���I��-6�-D�-D�_c�-d�d�
��*�%:��"�	=��	=�@"	�"	�g�o�o�"	�H	0�g�o�o�	0�$���#������!�!�$�(=�>rc��tjj|�|j|_g|_d|_yr)rrr�reset�insertCommentInitial�
insertComment�initial_commentsrmr%s rr�zTreeBuilder.resets3�������t�$�!�6�6��� "�����rc��t|�Sr)rjrxs  rrjzTreeBuilder.testSerializer#s
���g�&�&rc��tr|jjS|jjj�Sr)rt�documentr#r'r%s r�getDocumentzTreeBuilder.getDocument&s.����=�=�-�-�-��=�=�-�-�5�5�7�7rc��g}|jdj}|jr|j|j�|j	t|��|jr|j|j�|S)Nr)�openElementsr*rOrA�extend�listr;)r�fragmentr+s   r�getFragmentzTreeBuilder.getFragment,s`�����#�#�A�&�/�/���<�<��O�O�G�L�L�)�����W�
�&��<�<��O�O�G�L�L�)��rc��|d}|d}|d}|s"tjdt�d|_y|jj|�}||k7rtjdt�|j
|||�}||_y)Nrrrz#lxml cannot represent empty doctypez%lxml cannot represent non-xml doctype)�warnings�warnr
rmrdr��doctypeClass)r�tokenrrr�coercedNamerms       r�
insertDoctypezTreeBuilder.insertDoctype6s����V�}����$����$����M�M�?��Q��D�L��,�,�:�:�4�@�K��d�"��
�
�E��W��'�'��X�x�H�G�"�D�Lrc��|�||jusJ�|jj�J�|jj|�yr)r�r#r�rA)rr��parents   rr�z TreeBuilder.insertCommentInitialFsB���~��4�=�=�!8�8�8��}�}�)�)�1�1�1����$�$�T�*rc����||jk(rR|jjj�djtk(rtjdt�tt|�+||�y)N���z@lxml cannot represent adjacent comments beyond the root elements)r�r#r'r6rNr�r�r
�superrrr�)rr�r��	__class__s   �r�insertCommentMainzTreeBuilder.insertCommentMainKsV����d�m�m�#��
�
�*�*�2�2�4�R�8�<�<��L��M�M�\�^m�n�
�k�4�.�t�V�<rc�z�d}|j�r|jjsJ�|d|jjzz
}|jj�|jj��|d|jj|jjxsd�zz
}|jjr�|jj}|j
d�dk\r@|j
d�dk\r,tjdt�|jdd�}|j
d�dk\r	|d	|zz
}n|d
|zz
}n|dz
}|dz
}|jj|d
k7rtjdt�|dz
}tj|�}|jD]1}|j|d�}|j|j ��3|j#�|_|j'�|j$_|d
}|j+d|j,�}|�|}	nd|�d|��}	|	|_|j1||�}
||
_|j$j2j5|
�|j6j5|
�|j8|_y)Nroz<!DOCTYPE %sz
 PUBLIC "%s" �'rr:z6DOCTYPE system cannot contain single and double quotes�U00027z"%s"z'%s'z''r=rzGlxml cannot represent doctype with a different name to the root elementz$<THIS_SHOULD_NEVER_APPEAR_PUBLICLY/>r�r�rzr{)rmrrrrd�coercePubid�findr�r�r
�replacer�
fromstringr�r��addpreviousr*�
documentClassr��getroottreer#�get�defaultNamespacer6r�r$rAr�r�r�)rr��docStr�sysid�root�
comment_token�commentrr��	etree_tag�root_elements           r�
insertRootzTreeBuilder.insertRootQsp��
���<�<��<�<�$�$�$�$��n�t�|�|�'8�'8�8�8�F����%�%�1��L�L�)�)�5��?� �.�.�:�:�4�<�<�;P�;P�;V�TV�W�Y�Z���<�<�(�(� �L�L�1�1�E��z�z�#��!�+��
�
�3��1�0D� �
�
�&^�`o�p� %�
�
�c�8� <���z�z�#��!�+��&�5�.�0���&�5�.�0���d�N�F��c�M�F��|�|� � �E�&�M�1��
�
�g�ix�y��8�8������'��"�2�2�	/�M��'�'�
�f�(=�>�G����W�-�-�.�	/�
�*�*�,��
�%)�%5�%5�%7��
�
�"��V�}���I�I�k�4�+@�+@�A�	����I��%.�t�4�I�����(�(��y�9�� $����
�
�!�!�(�(��6���� � ��.�"�3�3��r)Fr)rrrr!r�rr�r�r��
fragmentClassr�implementationrr�rjr�r�r�r�r�r��
__classcell__)r�s@rrrrr�sP����M��L��L��L��M��N�Z?�x�'�8��#� +�
=�74rrr)#�__doc__�
__future__rrrr��rerL�collections.abcr�ImportError�collectionsrorrr
rrQr
�
lxml.etree�sixrrrt�compilerRr�r6rN�objectrr!rjrprrrrr�<module>r�s���	�C�B��	�
�+�.��'��%��� ���
�R�Z�Z��
(�
��u�}�}�U�#�'�'��!�6�!�*�v�*�$L�^&�RO4�$�"�"�O4��I�+�*�+�s�B.�.B<�;B<

Youez - 2016 - github.com/yon3zu
LinuXploit