LittleDemon WebShell


Linux server165.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Path : /opt/alt/python310/lib64/python3.10/html/__pycache__/
File Upload :
Command :
Current File : //opt/alt/python310/lib64/python3.10/html/__pycache__/parser.cpython-310.pyc

o

0�i�R�@s�dZddlZddlZddlmZdgZe�d�Ze�d�Ze�d�Z	e�d�Z
e�d	�Ze�d
�Ze�d�Z
e�d�Ze�d
�Ze�d�Ze�dej�Ze�dej�Ze�dej�Ze�d�Ze�d�ZGdd�dej�ZdS)zA parser for HTML and XHTML.�N)�unescape�
HTMLParserz[&<]z
&[a-zA-Z#]z%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]z)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]z	<[a-zA-Z]z
</[a-zA-Z]�>z--!?>z-?>z0([a-zA-Z][^\t\n\r\f />]*)(?:[\t\n\r\f ]|/(?!>))*a{
  (
    (?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]*  # attribute name
   )
  ([\t\n\r\f ]*=[\t\n\r\f ]*        # value indicator
    ('[^']*'                        # LITA-enclosed value
    |"[^"]*"                        # LIT-enclosed value
    |(?!['"])[^>\t\n\r\f ]*         # bare value
    )
   )?
  (?:[\t\n\r\f ]|/(?!>))*           # possibly followed by a space
a
  [a-zA-Z][^\t\n\r\f />]*           # tag name
  [\t\n\r\f /]*                     # optional whitespace before attribute name
  (?:(?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]*  # attribute name
    (?:[\t\n\r\f ]*=[\t\n\r\f ]*    # value indicator
      (?:'[^']*'                    # LITA-enclosed value
        |"[^"]*"                    # LIT-enclosed value
        |(?!['"])[^>\t\n\r\f ]*     # bare value
       )
     )?
    [\t\n\r\f /]*                   # possibly followed by a space
   )*
   >?
aF
  <[a-zA-Z][^\t\n\r\f />\x00]*       # tag name
  (?:[\s/]*                          # optional whitespace before attribute name
    (?:(?<=['"\s/])[^\s/>][^\s/=>]*  # attribute name
      (?:\s*=+\s*                    # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |"[^"]*"                   # LIT-enclosed value
          |(?!['"])[^>\s]*           # bare value
         )
        \s*                          # possibly followed by a space
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
z#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>c@seZdZdZdZdZddd�dd�Zd	d
�Zdd�Zd
d�Z	dZ
dd�Zdd�dd�Zdd�Z
d>dd�Zdd�Zdd�Zd>dd�Zd?d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z dS)@raEFind tags and other markup and call handler functions.

    Usage:
        p = HTMLParser()
        p.feed(data)
        ...
        p.close()

    Start tags are handled by calling self.handle_starttag() or
    self.handle_startendtag(); end tags by self.handle_endtag().  The
    data between tags is passed from the parser to the derived class
    by calling self.handle_data() with the data as argument (the data
    may be split up in arbitrary chunks).  If convert_charrefs is
    True the character references are converted automatically to the
    corresponding Unicode character (and self.handle_data() is no
    longer split in chunks), otherwise they are passed by calling
    self.handle_entityref() or self.handle_charref() with the string
    containing respectively the named or numeric reference as the
    argument.
    )ZscriptZstyleZxmpZiframeZnoembedZnoframes)Ztextarea�titleTF)�convert_charrefs�	scriptingcCs||_||_|��dS)azInitialize and reset this instance.

        If convert_charrefs is true (the default), all character references
        are automatically converted to the corresponding Unicode characters.

        If *scripting* is false (the default), the content of the
        ``noscript`` element is parsed normally; if it's true,
        it's returned as is without being parsed.
        N)rr�reset)�selfrr�r
�2/opt/alt/python310/lib64/python3.10/html/parser.py�__init__vs
zHTMLParser.__init__cCs4d|_d|_t|_d|_d|_d|_tj�	|�dS)z1Reset this instance.  Loses all unprocessed data.�z???NT)
�rawdata�lasttag�interesting_normal�interesting�
cdata_elem�_support_cdata�
_escapable�_markupbase�
ParserBaser�r	r
r
rr�szHTMLParser.resetcCs|j||_|�d�dS)z�Feed data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '\n').
        rN)r�goahead�r	�datar
r
r�feed�szHTMLParser.feedcCs|�d�dS)zHandle any buffered data.�N)rrr
r
r�close�szHTMLParser.closeNcCs|jS)z)Return full source of start tag: '<...>'.)�_HTMLParser__starttag_textrr
r
r�get_starttag_text�szHTMLParser.get_starttag_text��	escapablecCst|��|_||_|jdkrt�d�|_dS|r*|js*t�d|jtjtjB�|_dSt�d|jtjtjB�|_dS)N�	plaintextz\Zz&|</%s(?=[\t\n\r\f />])z</%s(?=[\t\n\r\f />]))	�lowerrr�re�compilerr�
IGNORECASE�ASCII)r	�elemr!r
r
r�set_cdata_mode�s




�

�zHTMLParser.set_cdata_modecCst|_d|_d|_dS)NT)rrrrrr
r
r�clear_cdata_mode�s
zHTMLParser.clear_cdata_modecCs
||_dS)aEnable or disable support of the CDATA sections.
        If enabled, "<[CDATA[" starts a CDATA section which ends with "]]>".
        If disabled, "<[CDATA[" starts a bogus comments which ends with ">".

        This method is not called by default. Its purpose is to be called
        in custom handle_starttag() and handle_endtag() methods, with
        value that depends on the adjusted current node.
        See https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state
        for details.
        N)r)r	�flagr
r
r�_set_support_cdata�s
zHTMLParser._set_support_cdatacCs|j}d}t|�}||k�rY|jr;|js;|�d|�}|dkr:|�dt||d��}|dkr8t�d��	||�s8�n!|}n|j
�	||�}|rI|��}n|jrN�n|}||kro|jrf|jrf|�
t|||���n	|�
|||��|�||�}||kr{�n�|j}|d|��r�t�||�r�|�|�}	n@|d|�r�|�|�}	n5|d|�r�|�|�}	n*|d|�r�|�|�}	n|d	|�r�|�|�}	n|d
|ks�|r�|�
d�|d
}	n�n�|	dk�r�|sِn�t�||�r�n�|d|��r|d|kr�|�
d�n�t�||�r�n�|�||dd��n�|d|��r0|}dD]}
|�|
|d
��r"|t|
�8}n�q|�||d
|��nW|d|��rF|j�rF|�||dd��nA|||d���dk�r_|�||dd��n(|d	|��rq|�||dd��n|d|��r�|�||dd��nt d��|}	|�||	�}n�|d|��r�t!�||�}|�r�|�"�dd�}|�#|�|�$�}	|d|	d
��s�|	d
}	|�||	�}q	d||d�v�r�|�
|||d��|�||d�}ny|d|��rQt%�||�}|�r|�"d
�}|�&|�|�$�}	|d|	d
��s	|	d
}	|�||	�}q	t'�||�}|�r;|�r:|�"�||d�k�r:|�$�}	|	|k�r2|}	|�||d
�}n|d
|k�rP|�
d�|�||d
�}nnJd��||ks|�r�||k�r�|j�ru|j�ru|�
t|||���n	|�
|||��|�||�}||d�|_dS)Nr�<�&�"z[\t\n\r\f ;]�</�<!--�<?�<!r�)z--!z--�-��	<![CDATA[��	�	<!doctypezwe should not get here!z&#����;zinteresting.search() lied)(r�lenrr�find�rfind�maxr$r%�searchr�startr�handle_datarZ	updatepos�
startswith�starttagopen�match�parse_starttag�parse_endtag�
parse_comment�parse_pi�parse_html_declaration�
endtagopen�handle_comment�endswithr�unknown_declr#�handle_decl�	handle_pi�AssertionError�charref�group�handle_charref�end�	entityref�handle_entityref�
incomplete)r	rVr�i�n�jZampposrFrD�k�suffix�namer
r
rr�s�
��







�




�}zHTMLParser.goaheadcCsp|j}|||d�dksJd��|||d�dkr |�|�S|||d�dkrJ|jrJ|�d|d�}|d	kr;d
S|�||d|��|dS|||d���dkrs|�d
|d�}|d
krdd
S|�||d|��|dS|||d�dkr�|�d
|d�}|d	kr�d
S||ddkr�|�||d|d��|dS|�||d|��|dS|�|�S)Nr4r3z+unexpected call to parse_html_declaration()r6r1r9r7z]]>rr;r8r:rrz<![�])	rrIrr>rOr#rPrM�parse_bogus_comment)r	rZrr\Zgtposr
r
rrKNs4
�
z!HTMLParser.parse_html_declarationcCsp|j}|�d|�s
Jd��t�||d�}|s#t�||d�}|s#dS|r4|��}|�||d|��|��S)Nr1�"unexpected call to parse_comment()r6r;)	rrD�commentcloserA�commentabruptcloserFrBrMrV)r	rZ�reportrrFr\r
r
rrIpszHTMLParser.parse_commentrcCs`|j}|||d�dvsJd��|�d|d�}|dkrdS|r,|�||d|��|dS)Nr4)r3r0rbrr;r)rr>rM)r	rZrer�posr
r
rraszHTMLParser.parse_bogus_commentcCsd|j}|||d�dksJd��t�||d�}|sdS|��}|�||d|��|��}|S)Nr4r2zunexpected call to parse_pi()r;)r�picloserArBrQrV�r	rZrrFr\r
r
rrJ�szHTMLParser.parse_picCsd|_|�|�}|dkr|S|j}|||�|_g}t�||d�}|s(Jd��|��}|�d���|_}||kr�t	�||�}|sCnS|�ddd�\}	}
}|
sRd}n-|dd�dkrd|dd�ksyn|dd�dkrw|dd�krnn|dd�}|r�t
|�}|�|	��|f�|��}||ks:|||���}|d	vr�|�
�\}
}d
|jvr�|
|j�d
�}
t|j�|j�d
�}n|t|j�}|�|||��|S|�d�r�|�||�|S|�||�||jvs�|jr�|dks�|d
kr�|j|dd�|S||jv�r|j|dd�|S)Nrrz#unexpected call to parse_starttag()r4r8�'r;�")r�/>�
rkZnoscriptr"Fr T)r�check_for_whole_start_tagr�tagfind_tolerantrFrVrTr#r�attrfind_tolerantr�append�stripZgetpos�countr=r?rCrN�handle_startendtag�handle_starttag�CDATA_CONTENT_ELEMENTSrr)�RCDATA_CONTENT_ELEMENTS)r	rZ�endposr�attrsrFr]�tag�m�attrname�restZ	attrvaluerV�lineno�offsetr
r
rrG�sf
&(�

�
	�
��zHTMLParser.parse_starttagcCs>|j}t�||d�}|sJ�|��}||ddkrdS|S)Nrrr;)r�locatetagendrFrVrhr
r
rrm�sz$HTMLParser.check_for_whole_start_tagcCs�|j}|||d�dksJd��|�d|d�dkrdSt�||�s8||d|d�dkr3|dS|�|�St�||d�}|sDJ�|��}||ddkrRdSt�||d�}|s^J�|�d��	�}|�
|�|��|S)	Nr4r0zunexpected call to parse_endtagrrr;r8r)rr>rLrFrarrVrnrTr#�
handle_endtagr*)r	rZrrFr\ryr
r
rrH�s&

zHTMLParser.parse_endtagcCs|�||�|�|�dS�N)rtr��r	ryrxr
r
rrs�szHTMLParser.handle_startendtagcC�dSr�r
r�r
r
rrt��zHTMLParser.handle_starttagcCr�r�r
)r	ryr
r
rr�r�zHTMLParser.handle_endtagcCr�r�r
�r	r_r
r
rrUr�zHTMLParser.handle_charrefcCr�r�r
r�r
r
rrX	r�zHTMLParser.handle_entityrefcCr�r�r
rr
r
rrC
r�zHTMLParser.handle_datacCr�r�r
rr
r
rrMr�zHTMLParser.handle_commentcCr�r�r
)r	Zdeclr
r
rrPr�zHTMLParser.handle_declcCr�r�r
rr
r
rrQr�zHTMLParser.handle_picCr�r�r
rr
r
rrOr�zHTMLParser.unknown_decl)T)r)!�__name__�
__module__�__qualname__�__doc__rurvrrrrrrr)r*r,rrKrIrarJrGrmrHrsrtr�rUrXrCrMrPrQrOr
r
r
rrZs@
	

"
9
)r�r$rZhtmlr�__all__r%rrYrWrSrErLrgrcrdrn�VERBOSErorZlocatestarttagend_tolerantZ	endendtagZ
endtagfindrrr
r
r
r�<module>s6











�
��



LittleDemon - FACEBOOK
[ KELUAR ]