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/treewalkers/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

V=�^4��"�ddlmZmZmZddlmZddlmZmZm	Z	gd�Z
ejZejZejZej"Zej&Zej*ZdZdj1e	�Z	Gd�d	e�ZGd
�de�Zy)
�)�absolute_import�division�unicode_literals)�Node�)�
namespaces�voidElements�spaceCharacters)	�DOCUMENT�DOCTYPE�TEXT�ELEMENT�COMMENT�ENTITY�UNKNOWN�
TreeWalker�NonRecursiveTreeWalkerz<#UNKNOWN#>�c�V�eZdZdZd�Zd�Zd�Zdd�Zd�Zd�Z	d�Z
d	�Zdd�Zd�Z
d
�Zy
)rz}Walks a tree yielding tokens

    Tokens are dicts that all have a ``type`` field specifying the type of the
    token.

    c��||_y)zCCreates a TreeWalker

        :arg tree: the tree to walk

        N)�tree)�selfrs  �;/usr/lib/python3/dist-packages/html5lib/treewalkers/base.py�__init__zTreeWalker.__init__s����	�c��t��N��NotImplementedError)rs r�__iter__zTreeWalker.__iter__#���!�!rc��d|d�S)z�Generates an error token with the given message

        :arg msg: the error message

        :returns: SerializeError token

        �SerializeError��type�data�)r�msgs  r�errorzTreeWalker.error&s��)�#�6�6rc#�JK�d|||d���|r|jd���yy�w)arGenerates an EmptyTag token

        :arg namespace: the namespace of the token--can be ``None``

        :arg name: the name of the element

        :arg attrs: the attributes of the element as a dict

        :arg hasChildren: whether or not to yield a SerializationError because
            this tag shouldn't have children

        :returns: EmptyTag token

        �EmptyTag�r%�name�	namespacer&zVoid element has childrenN�r))rr.r-�attrs�hasChildrens     r�emptyTagzTreeWalker.emptyTag0s7����"�4�%���	���*�*�8�9�9��s�!#c��d|||d�S)z�Generates a StartTag token

        :arg namespace: the namespace of the token--can be ``None``

        :arg name: the name of the element

        :arg attrs: the attributes of the element as a dict

        :returns: StartTag token

        �StartTagr,r')rr.r-r0s    r�startTagzTreeWalker.startTagEs��#��&���	rc��d||d�S)z�Generates an EndTag token

        :arg namespace: the namespace of the token--can be ``None``

        :arg name: the name of the element

        :returns: EndTag token

        �EndTag)r%r-r.r')rr.r-s   r�endTagzTreeWalker.endTagVs��!��&�(�	(rc#��K�|}|jt�}|dt|�t|�z
}|rd|d���|}|jt�}|t|�d}|rd|d���|rd|d���yy�w)atGenerates SpaceCharacters and Characters tokens

        Depending on what's in the data, this generates one or more
        ``SpaceCharacters`` and ``Characters`` tokens.

        For example:

            >>> from html5lib.treewalkers.base import TreeWalker
            >>> # Give it an empty tree just so it instantiates
            >>> walker = TreeWalker([])
            >>> list(walker.text(''))
            []
            >>> list(walker.text('  '))
            [{u'data': '  ', u'type': u'SpaceCharacters'}]
            >>> list(walker.text(' abc '))  # doctest: +NORMALIZE_WHITESPACE
            [{u'data': ' ', u'type': u'SpaceCharacters'},
            {u'data': u'abc', u'type': u'Characters'},
            {u'data': u' ', u'type': u'SpaceCharacters'}]

        :arg data: the text data

        :returns: one or more ``SpaceCharacters`` and ``Characters`` tokens

        N�SpaceCharactersr$�
Characters)�lstripr
�len�rstrip)rr&�middle�left�rights     r�textzTreeWalker.textds�����2�����_�-���,�S��Y��V��,�-���,�d�;�;������_�-���S��[�\�"���'��8�8��,�e�<�<��s�A4A6c��d|d�S)zdGenerates a Comment token

        :arg data: the comment

        :returns: Comment token

        �Commentr$r')rr&s  r�commentzTreeWalker.comment�s��"�4�0�0rNc��d|||d�S)z�Generates a Doctype token

        :arg name:

        :arg publicId:

        :arg systemId:

        :returns: the Doctype token

        �Doctype)r%r-�publicId�systemIdr')rr-rHrIs    r�doctypezTreeWalker.doctype�s��"��$�$�&�	&rc��d|d�S)zjGenerates an Entity token

        :arg name: the entity name

        :returns: an Entity token

        �Entity)r%r-r')rr-s  r�entityzTreeWalker.entity�s��!�$�/�/rc�*�|jd|z�S)zHandles unknown node typeszUnknown node type: r/)r�nodeTypes  r�unknownzTreeWalker.unknown�s���z�z�/�(�:�;�;r)F)NN)�__name__�
__module__�__qualname__�__doc__rr r)r2r5r8rBrErJrMrPr'rrrrs?����"�7�:�*�"(�$=�L1�&�"0�<rrc�*�eZdZd�Zd�Zd�Zd�Zd�Zy)rc��t�rr�r�nodes  r�getNodeDetailsz%NonRecursiveTreeWalker.getNodeDetails�r!rc��t�rrrWs  r�
getFirstChildz$NonRecursiveTreeWalker.getFirstChild�r!rc��t�rrrWs  r�getNextSiblingz%NonRecursiveTreeWalker.getNextSibling�r!rc��t�rrrWs  r�
getParentNodez$NonRecursiveTreeWalker.getParentNode�r!rc#�K�|j}|���|j|�}|d|dd}}d}|tk(r|j|���n�|tk(r|j
|�D]}|���n�|tk(rS|\}}}}|r|tdk(r(|tvr |j||||�D]}|���d}nx|j|||���nb|tk(r|j|d���nB|tk(r|j|d���n"|tk(rd}n|j!|d���|r|j#|�}	nd}	|	�|	}n�|��|j|�}|d|dd}}|tk(r1|\}}}}|r|tdk7s|tvr|j%||���|j|urd}n*|j'|�}
|
�|
}n|j)|�}|���|����yy�w)Nr�F�htmlT)rrYrrJr
rBrrr	r2r5rrErrMrrPr[r8r]r_)r�currentNode�detailsr%r1�tokenr.r-�
attributes�
firstChild�nextSiblings           rr zNonRecursiveTreeWalker.__iter__�s�����i�i���%��)�)�+�6�G�#�A�J�����'�D��K��w��"�d�l�l�G�,�,����&�T�Y�Y��0� �E��K� ����;B�8�	�4��[�!�Y�*�V�2D�%D�$�R^�J^�!%���y�$�
�/:�"<�$��#��$�#(�K��-�-�	�4��D�D�����l�l�7�1�:�.�.�����k�k�'�!�*�-�-���!�"���l�l�7�1�:�.�.��!�/�/��<�
�!�
��%�(��!�-�"�1�1�+�>�G�$+�A�J�����'�D��w��CJ�@�	�4��[�%�)�z�&�7I�*I�d�Zf�Nf�"&�+�+�i��">�>��y�y�K�/�&*���"&�"5�"5�k�"B�K�"�.�&1���&*�&8�&8��&E��"�-�U�%�s�GG�G�GN)rQrRrSrYr[r]r_r r'rrrr�s��"�"�"�"�;FrrN)�
__future__rrr�xml.domr�	constantsrr	r
�__all__�
DOCUMENT_NODEr�DOCUMENT_TYPE_NODEr�	TEXT_NODEr
�ELEMENT_NODEr�COMMENT_NODEr�ENTITY_NODErr�join�objectrrr'rr�<module>rus���B�B��A�A�3������
�
!�
!���~�~��
�
�
��
�
�
��	
�	�	��
���'�'�/�*��]<��]<�@HF�Z�HFr

Youez - 2016 - github.com/yon3zu
LinuXploit