- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 3.133.143.199
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 8.2.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/html5lib/treebuilders/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.6/site-packages/html5lib/treebuilders/__pycache__/base.cpython-36.opt-1.pyc
3

B;�Wj6�@s�ddlmZmZmZddlmZddlmZmZm	Z	dZ
ee�dfeeee	ddfg�B�dfeeee	dd	fe	dd
fg�B�dfee	ddfe	ddfg�dfee	ddfe	dd
fg�dfd�Z
Gdd�de�ZGdd�de�ZGdd�de�ZdS)�)�absolute_import�division�unicode_literals)�	text_type�)�scopingElements�tableInsertModeElements�
namespacesNF�html�buttonZolZul�table�optgroup�optionT)Nr�listrZselectc@s^eZdZdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zd	S)�NodecCs(||_d|_d|_i|_g|_g|_dS)a6Node representing an item in the tree.
        name - The tag name associated with the node
        parent - The parent of the current node (or None for the document node)
        value - The value of the current node (applies to text nodes and
        comments
        attributes - a dict holding name, value pairs for attributes of the node
        childNodes - a list of child nodes of the current node. This must
        include all elements but not necessarily other node types
        _flags - A list of miscellaneous flags that can be set on the node
        N)�name�parent�value�
attributes�
childNodesZ_flags)�selfr�r�/usr/lib/python3.6/base.py�__init__sz
Node.__init__cCs:djdd�|jj�D��}|r,d|j|fSd|jSdS)N� cSsg|]\}}d||f�qS)z%s="%s"r)�.0rrrrr�
<listcomp>+sz Node.__str__.<locals>.<listcomp>z<%s %s>z<%s>)�joinr�itemsr)rZ
attributesStrrrr�__str__*s

zNode.__str__cCs
d|jS)Nz<%s>)r)rrrr�__repr__3sz
Node.__repr__cCst�dS)z3Insert node as a child of the current node
        N)�NotImplementedError)r�noderrr�appendChild6szNode.appendChildNcCst�dS)z�Insert data as text in the current node, positioned before the
        start of node insertBefore or to the end of the node's text.
        N)r!)r�data�insertBeforerrr�
insertText;szNode.insertTextcCst�dS)z�Insert 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 nodeN)r!)rr"ZrefNoderrrr%AszNode.insertBeforecCst�dS)z:Remove node from the children of the current node
        N)r!)rr"rrr�removeChildGszNode.removeChildcCs$x|jD]}|j|�qWg|_dS)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
        N)rr#)rZ	newParentZchildrrr�reparentChildrenLszNode.reparentChildrencCst�dS)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
        N)r!)rrrr�	cloneNodeVszNode.cloneNodecCst�dS)zFReturn true if the node has children or text, false otherwise
        N)r!)rrrr�
hasContent\szNode.hasContent)N)
�__name__�
__module__�__qualname__rrr r#r&r%r'r(r)r*rrrrrs	

rc@seZdZdd�Zdd�ZdS)�ActiveFormattingElementscCsfd}|tkrVxH|ddd�D]6}|tkr*P|j||�r>|d7}|dkr|j|�PqWtj||�dS)Nr�����)�Marker�
nodesEqual�remover�append)rr"Z
equalCount�elementrrrr5cs
zActiveFormattingElements.appendcCs$|j|jksdS|j|jks dSdS)NFT)�	nameTupler)rZnode1Znode2rrrr3ps
z#ActiveFormattingElements.nodesEqualN)r+r,r-r5r3rrrrr.bs
r.c@s�eZdZdZdZdZdZdZdZdd�Z	dd�Z
d+dd�Zd	d
�Zdd�Z
d
d�Zdd�Zdd�Zd,dd�Zdd�Zdd�Zdd�Zeee�Zdd�Zdd�Zd-dd �Zd!d"�Zd.d#d$�Zd%d&�Zd'd(�Zd)d*�ZdS)/�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
    NcCs|rd|_nd|_|j�dS)Nzhttp://www.w3.org/1999/xhtml)�defaultNamespace�reset)rZnamespaceHTMLElementsrrrr�szTreeBuilder.__init__cCs.g|_t�|_d|_d|_d|_|j�|_dS)NF)�openElementsr.�activeFormattingElementsZheadPointerZformPointer�insertFromTable�
documentClass�document)rrrrr:�szTreeBuilder.resetcCs~t|d�}|s$t|t�r$td|f}t|\}}xHt|j�D]:}|rP||krPdS|rd|j|krddS||j|kAr<dSq<WdS)Nr7r
TF)�hasattr�
isinstancerr	�listElementsMap�reversedr;r7)r�targetZvariantZ	exactNodeZlistElements�invertr"rrr�elementInScope�s

zTreeBuilder.elementInScopecCs�|js
dSt|j�d}|j|}|tks4||jkr8dSx6|tkrn||jkrn|dkrZd}P|d8}|j|}q:WxR|d7}|j|}|j�}|jd|j|j|jd��}||j|<||jdkrrPqrWdS)Nr/rZStartTag)�typer�	namespacer$r1r1)	r<�lenr2r;r)�
insertElementrrHr)r�i�entryZcloner6rrr�#reconstructActiveFormattingElements�s.


z/TreeBuilder.reconstructActiveFormattingElementscCs,|jj�}x|jr&|tkr&|jj�}qWdS)N)r<�popr2)rrLrrr�clearActiveFormattingElements�s
z)TreeBuilder.clearActiveFormattingElementscCs8x2|jddd�D]}|tkr"Pq|j|kr|SqWdS)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 falseNr/Fr1)r<r2r)rr�itemrrr�!elementInActiveFormattingElements�s
z-TreeBuilder.elementInActiveFormattingElementscCs&|j|�}|jj|�|jj|�dS)N)�
createElementr;r5r?r#)r�tokenr6rrr�
insertRoot�s
zTreeBuilder.insertRootcCs6|d}|d}|d}|j|||�}|jj|�dS)Nr�publicId�systemId)�doctypeClassr?r#)rrSrrUrVZdoctyperrr�
insertDoctypes
zTreeBuilder.insertDoctypecCs*|dkr|jd}|j|j|d��dS)Nr/r$r1)r;r#�commentClass)rrSrrrr�
insertComment	s
zTreeBuilder.insertCommentcCs0|d}|jd|j�}|j||�}|d|_|S)z.Create an element but don't insert it anywhererrHr$)�getr9�elementClassr)rrSrrHr6rrrrRs

zTreeBuilder.createElementcCs|jS)N)�_insertFromTable)rrrr�_getInsertFromTableszTreeBuilder._getInsertFromTablecCs ||_|r|j|_n|j|_dS)zsSwitch the function used to insert an element from the
        normal one to the misnested table one and back againN)r]�insertElementTablerJ�insertElementNormal)rrrrr�_setInsertFromTables
zTreeBuilder._setInsertFromTablecCsL|d}|jd|j�}|j||�}|d|_|jdj|�|jj|�|S)NrrHr$r/r1)r[r9r\rr;r#r5)rrSrrHr6rrrr`$s
zTreeBuilder.insertElementNormalcCs`|j|�}|jdjtkr$|j|�S|j�\}}|dkrD|j|�n|j||�|jj|�|S)z-Create an element and insert it into the treer/Nr1)	rRr;rrr`�getTableMisnestedNodePositionr#r%r5)rrSr6rr%rrrr_.s

zTreeBuilder.insertElementTablecCsX|dkr|jd}|js0|jr<|jdjtkr<|j|�n|j�\}}|j||�dS)zInsert text data.Nr/r1r1)r;r=rrr&rb)rr$rr%rrrr&>s

zTreeBuilder.insertTextcCsvd}d}d}x(|jddd�D]}|jdkr|}PqW|rd|jrL|j}|}qn|j|jj|�d}n
|jd}||fS)zsGet the foster parent element, and sibling to insert before
        (or None) when inserting a misnested table nodeNr/rrr1)r;rr�index)rZ	lastTableZfosterParentr%ZelmrrrrbMs

z)TreeBuilder.getTableMisnestedNodePositionc
Cs8|jd
j}|td�kr4||kr4|jj�|j|�dS)Nr/�dd�dt�lirr
�p�rp�rtr1)rdrerfrr
rgrhri)r;r�	frozensetrN�generateImpliedEndTags)r�excluderrrrrkgs

z"TreeBuilder.generateImpliedEndTagscCs|jS)zReturn the final tree)r?)rrrr�getDocumentqszTreeBuilder.getDocumentcCs|j�}|jdj|�|S)zReturn the final fragmentr)�
fragmentClassr;r()rZfragmentrrr�getFragmentuszTreeBuilder.getFragmentcCst�dS)zzSerialize the subtree of node in the format required by unit tests
        node - the node from which to start serializingN)r!)rr"rrr�testSerializer|szTreeBuilder.testSerializer)N)N)N)N)r+r,r-�__doc__r>r\rYrWrnrr:rFrMrOrQrTrXrZrRr^ra�propertyr=r`r_r&rbrkrmrorprrrrr8zs6
.
	




r8)Z
__future__rrrZsixrZ	constantsrrr	r2rj�setrB�objectrrr.r8rrrr�<module>s
K

Youez - 2016 - github.com/yon3zu
LinuXploit