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__/base.cpython-312.pyc
�

V=�^�8�	�>�ddlmZmZmZddlmZddlmZmZm	Z	dZ
ee�dfeee	ddfhz�dfeee	dd	fe	dd
fhz�dfee	ddfe	ddfg�dfee	ddfe	dd
fg�dfd�ZGd�de
�ZGd�de�ZGd�de
�Zy)�)�absolute_import�division�unicode_literals)�	text_type�)�scopingElements�tableInsertModeElements�
namespacesNF�html�button�ol�ul�table�optgroup�optionT)Nr�listr�selectc�N�eZdZdZd�Zd�Zd�Zd�Zd
d�Zd�Z	d	�Z
d
�Zd�Zd�Z
y)�NodezRepresents an item in the treec�X�||_d|_d|_i|_g|_g|_y)zRCreates a Node

        :arg name: The tag name associated with the node

        N)�name�parent�value�
attributes�
childNodes�_flags)�selfrs  �</usr/lib/python3/dist-packages/html5lib/treebuilders/base.py�__init__z
Node.__init__s0����	������
����������c
���dj|jj�D��cgc]
\}}|�d|�d���c}}�}|rd|j�d|�d�Sd|jzScc}}w)N� z="�"�<�>�<%s>)�joinr�itemsr)rrr�
attributesStrs    r�__str__zNode.__str__-sd�����"&�/�/�"7�"7�"9�";�&1�d�E�26�u�"=�";�<�
�� $�	�	�=�9�9��T�Y�Y�'�'��
";s�A'
c� �d|jzS)Nr&)r�rs r�__repr__z
Node.__repr__6s������#�#r c��t�)z[Insert node as a child of the current node

        :arg node: the node to insert

        ��NotImplementedError�r�nodes  r�appendChildzNode.appendChild9�
��"�!r Nc��t�)aBInsert data as text in the current node, positioned before the
        start of node insertBefore or to the end of the node's text.

        :arg data: the data to insert

        :arg insertBefore: True if you want to insert the text before the node
            and False if you want to insert it after the node

        r/)r�data�insertBefores   r�
insertTextzNode.insertTextA�
��"�!r c��t�)aInsert node as a child of the current node, before refNode in the
        list of child nodes. Raises ValueError if refNode is not a child of
        the current node

        :arg node: the node to insert

        :arg refNode: the child node to insert the node before

        r/)rr2�refNodes   rr7zNode.insertBeforeMr9r c��t�)zhRemove node from the children of the current node

        :arg node: the child node to remove

        r/r1s  r�removeChildzNode.removeChildYr4r c�V�|jD]}|j|��g|_y)z�Move all the children of the current node to newParent.
        This is needed so that trees that don't store text as nodes move the
        text in the correct way

        :arg newParent: the node to move all this node's children to

        N)rr3)r�	newParent�childs   r�reparentChildrenzNode.reparentChildrenas,���_�_�	)�E��!�!�%�(�	)���r c��t�)z�Return a shallow copy of the current node i.e. a node with the same
        name and attributes but with no parent or child nodes
        r/r,s r�	cloneNodezNode.cloneNodens
��"�!r c��t�)zFReturn true if the node has children or text, false otherwise
        r/r,s r�
hasContentzNode.hasContentts
��"�!r �N)�__name__�
__module__�__qualname__�__doc__rr*r-r3r8r7r=rArCrE�r rrrs7��(��((�$�"�
"�
"�"��"�"r rc��eZdZd�Zd�Zy)�ActiveFormattingElementsc���d}|tk7rG|ddd�D]<}|tk(rn1|j||�r|dz
}|dk(s�+|j|�ntj	||�y)Nr�����)�Marker�
nodesEqual�remover�append)rr2�
equalCount�elements    rrUzActiveFormattingElements.append{sm���
��6�>���"��:�
���f�$���?�?�7�D�1��!�O�J���?��K�K��(��
�	
���D�$�r c�l�|j|jk(sy|j|jk(syy)NFT)�	nameTupler)r�node1�node2s   rrSz#ActiveFormattingElements.nodesEqual�s/�����%�/�/�1�����5�#3�#3�3��r N)rGrHrIrUrSrKr rrMrMzs�� �r rMc��eZdZdZdZdZdZdZdZd�Z	d�Z
dd�Zd�Zd�Z
d�Zd	�Zd
�Zdd�Zd�Zd
�Zd�Zeee�Zd�Zd�Zdd�Zd�Zdd�Zd�Zd�Zd�Zy)�TreeBuilderaBase treebuilder implementation

    * documentClass - the class to use for the bottommost node of a document
    * elementClass - the class to use for HTML Elements
    * commentClass - the class to use for comments
    * doctypeClass - the class to use for doctypes

    Nc�F�|rd|_nd|_|j�y)zmCreate a TreeBuilder

        :arg namespaceHTMLElements: whether or not to namespace HTML elements

        zhttp://www.w3.org/1999/xhtmlN)�defaultNamespace�reset)r�namespaceHTMLElementss  rrzTreeBuilder.__init__�s ��!�$B�D�!�$(�D�!��
�
�r c��g|_t�|_d|_d|_d|_|j
�|_y)NF)�openElementsrM�activeFormattingElements�headPointer�formPointer�insertFromTable�
documentClass�documentr,s rr`zTreeBuilder.reset�s?�����(@�(B��%� ������$����*�*�,��
r c�&�t|d�}|s-t|t�rtd|f}t|t�sJ�t
|\}}t
|j�D]1}|r||k(ry|s|j|k(ry||j|vzs�1yJ�)NrYrTF)	�hasattr�
isinstancerr
�tuple�listElementsMap�reversedrcrY)r�target�variant�	exactNode�listElements�invertr2s       r�elementInScopezTreeBuilder.elementInScope�s����F�K�0�	���&�)�,�$�V�,�f�5���f�e�,�,�,�.�w�7���f��T�.�.�/�	�D��T�V�^���4�>�>�V�#;���D�N�N�l�:�;��
	�	�ur c�(�|jsyt|j�dz
}|j|}|tk(s||jvry|tk7rB||jvr4|dk(rd}n,|dz}|j|}|tk7r||jvr�4	|dz
}|j|}|j	�}|jd|j|j|jd��}||j|<||jdk(ry�{)NrPrrO�StartTag)�typer�	namespacer6)	rd�lenrRrcrC�
insertElementrryr)r�i�entry�clonerWs     r�#reconstructActiveFormattingElementsz/TreeBuilder.reconstructActiveFormattingElements�s/���,�,��
��-�-�.��2���-�-�a�0���F�?�e�t�'8�'8�8���v�o�%�t�/@�/@�"@��A�v����
��F�A��1�1�!�4�E��v�o�%�t�/@�/@�"@��
��F�A��1�1�!�4�E��O�O�%�E��(�(�*�27�*�*�7<���27�2B�2B�*D�E�G�07�D�)�)�!�,��$�7�7��;�;��'r c���|jj�}|jr<|tk7r2|jj�}|jr|tk7r�0yyyyrF)rd�poprR)rr}s  r�clearActiveFormattingElementsz)TreeBuilder.clearActiveFormattingElementssR���-�-�1�1�3���+�+�����1�1�5�5�7�E��+�+����+��+r c�n�|jddd�D] }|tk(ry|j|k(s�|cSy)z�Check if an element exists between the end of the active
        formatting elements and the last marker. If it does, return it, else
        return falseNrOF)rdrRr)rr�items   r�!elementInActiveFormattingElementsz-TreeBuilder.elementInActiveFormattingElements
sK��
�1�1�$�B�$�7�	�D��v�~������d�"���
	�r c��|j|�}|jj|�|jj	|�yrF)�
createElementrcrUrir3)r�tokenrWs   r�
insertRootzTreeBuilder.insertRoots8���$�$�U�+����� � ��)��
�
�!�!�'�*r c�~�|d}|d}|d}|j|||�}|jj|�y)Nr�publicId�systemId)�doctypeClassrir3)rr�rr�r��doctypes      r�
insertDoctypezTreeBuilder.insertDoctype sE���V�}����$����$���#�#�D�(�H�=���
�
�!�!�'�*r c�l�|�|jd}|j|j|d��y)NrOr6)rcr3�commentClass)rr�rs   r�
insertCommentzTreeBuilder.insertComment(s4���>��&�&�r�*�F����4�,�,�U�6�]�;�<r c��|d}|jd|j�}|j||�}|d|_|S)z.Create an element but don't insert it anywhererryr6)�getr_�elementClassr�rr�rryrWs     rr�zTreeBuilder.createElement-sD���V�}���I�I�k�4�+@�+@�A�	��#�#�D�)�4��"�6�]����r c��|jSrF)�_insertFromTabler,s r�_getInsertFromTablezTreeBuilder._getInsertFromTable5s���$�$�$r c�\�||_|r|j|_y|j|_y)zsSwitch the function used to insert an element from the
        normal one to the misnested table one and back againN)r��insertElementTabler{�insertElementNormal)rrs  r�_setInsertFromTablezTreeBuilder._setInsertFromTable8s+��!&����!%�!8�!8�D��!%�!9�!9�D�r c�&�|d}t|t�s
Jd|z��|jd|j�}|j	||�}|d|_|jdj|�|jj|�|S)NrzElement %s not unicoderyr6rO)	rlrr�r_r�rrcr3rUr�s     rr�zTreeBuilder.insertElementNormalCs����V�}���$�	�*�K�,D�t�,K�K�*��I�I�k�4�+@�+@�A�	��#�#�D�)�4��"�6�]������"��)�)�'�2���� � ��)��r c�0�|j|�}|jdjtvr|j	|�S|j�\}}|�|j
|�n|j||�|jj|�|S)z-Create an element and insert it into the treerO)	r�rcrr	r��getTableMisnestedNodePositionr3r7rU)rr�rWrr7s     rr�zTreeBuilder.insertElementTableMs����$�$�U�+�����R� �%�%�-D�D��+�+�E�2�2�$(�#E�#E�#G� �F�L��#��"�"�7�+��#�#�G�\�:����$�$�W�-��r c��|�|jd}|jr+|jr1|jdjtvr|j	|�y|j�\}}|j	||�y)zInsert text data.NrO)rcrgrr	r8r�)rr6rr7s    rr8zTreeBuilder.insertText]sx���>��&�&�r�*�F��$�$��)=�)=�)-�):�):�2�)>�)C�)C�0G�*H����d�#�$(�#E�#E�#G� �F�L����d�L�1r c�&�d}d}d}|jddd�D]}|jdk(s�|}n|rM|jr|j}|}||fS|j|jj|�dz
}||fS|jd}||fS)zsGet the foster parent element, and sibling to insert before
        (or None) when inserting a misnested table nodeNrOrrPr)rcrr�index)r�	lastTable�fosterParentr7�elms     rr�z)TreeBuilder.getTableMisnestedNodePositionls����	������$�$�T�r�T�*�	�C��x�x�7�"��	��	�����(�/�/��(���\�)�)�	 $�0�0��%�%�+�+�I�6��:� <���\�)�)� �,�,�Q�/�L��\�)�)r c��|jdj}|td�vr2||k7r,|jj�|j	|�yyy)NrO)�dd�dt�lirr�p�rp�rt)rcr�	frozensetr��generateImpliedEndTags)r�excluders   rr�z"TreeBuilder.generateImpliedEndTags�sZ��� � ��$�)�)���I�W�X�X�������!�!�#�
�'�'��0�	 �
Yr c��|jS)zReturn the final tree)rir,s r�getDocumentzTreeBuilder.getDocument�s���}�}�r c�b�|j�}|jdj|�|S)zReturn the final fragmentr)�
fragmentClassrcrA)r�fragments  r�getFragmentzTreeBuilder.getFragment�s0���%�%�'�����!��-�-�h�7��r c��t�)z�Serialize the subtree of node in the format required by unit tests

        :arg node: the node from which to start serializing

        r/r1s  r�testSerializerzTreeBuilder.testSerializer�r4r rF)rGrHrIrJrhr�r�r�r�rr`rurr�r�r�r�r�r�r�r��propertyrgr�r�r8r�r�r�r�r�rKr rr]r]�s�����M��L��L��L��M�
�
-��,,�\8�
�+�
+�=�
�%�:��2�4G�H�O��� 
2�*�41���"r r])�
__future__rrr�sixr�	constantsrr	r
rRr�rn�objectrrrMr]rKr r�<module>r�s��B�B��L�L�

���_�%�u�
-���Z��-?��,J�+K�K�L�e�T�
��:�f�+=�t�*D�+5�f�+=�t�*D�*F�F�G�HM�
O��*�V�,�f�5�$�V�,�g�6�8�9�:?�A��:�f�-�z�:�%�f�-�x�8�:�;�<@�B�	��`"�6�`"�F�t��0O"�&�O"r 

Youez - 2016 - github.com/yon3zu
LinuXploit