https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/future/backports/html/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/future/backports/html/__pycache__/parser.cpython-310.pyc
o

,�]:M�@sdZddlmZmZmZmZddlTddlmZddl	Z	ddl
Z
e	�d�Ze	�d�Z
e	�d�Ze	�d	�Ze	�d
�Ze	�d�Ze	�d�Ze	�d
�Ze	�d�Ze	�d�Ze	�d�Ze	�de	j�Ze	�de	j�Ze	�d�Ze	�d�ZGdd�de�ZGdd�dej�ZdS)zLA parser for HTML and XHTML.

Backported for python-future from Python 3.3.
�)�absolute_import�division�print_function�unicode_literals)�*)�_markupbaseNz[&<]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--\s*>z(([a-zA-Z][-.a-zA-Z0-9:_]*)(?:\s|/(?!>))*z[a-zA-Z][^	

 />]*zJ\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*(\'[^\']*\'|"[^"]*"|[^\s"\'=<>`]*))?z]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*a�
  <[a-zA-Z][-.a-zA-Z0-9:_]*          # tag name
  (?:\s+                             # whitespace before attribute name
    (?:[a-zA-Z_][-.:a-zA-Z0-9_]*     # attribute name
      (?:\s*=\s*                     # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |\"[^\"]*\"                # LIT-enclosed value
          |[^'\">\s]+                # bare value
         )
       )?
     )
   )*
  \s*                                # trailing whitespace
aF
  <[a-zA-Z][-.a-zA-Z0-9:_]*          # 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 comma
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
z#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>c@s"eZdZdZddd�Zdd�ZdS)	�HTMLParseErrorz&Exception raised for all parse errors.�NNcCs&|sJ�||_|d|_|d|_dS)Nr���msg�lineno�offset)�selfr
�position�r�>/usr/lib/python3/dist-packages/future/backports/html/parser.py�__init__Us
zHTMLParseError.__init__cCs>|j}|jdur|d|j}|jdur|d|jd}|S)Nz, at line %dz, column %drr)r�resultrrr�__str__[s

zHTMLParseError.__str__N)r
)�__name__�
__module__�__qualname__�__doc__rrrrrrr	Rs
r	c@s�eZdZdZdZd:dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dZ
dd�Zdd�Zdd�Z
dd�Zdd�Zd;dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS)<�
HTMLParsera�Find 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).  Entity references are
    passed by calling self.handle_entityref() with the entity
    reference as the argument.  Numeric character references are
    passed to self.handle_charref() with the string containing the
    reference as the argument.
    )�script�styleFcCs&|r
tjdtdd�||_|��dS)z�Initialize and reset this instance.

        If strict is set to False (the default) the parser will parse invalid
        markup, otherwise it will raise an error.  Note that the strict mode
        is deprecated.
        zThe strict mode is deprecated.�)�
stacklevelN)�warnings�warn�DeprecationWarning�strict�reset)rr#rrrrzs�zHTMLParser.__init__cCs(d|_d|_t|_d|_tj�|�dS)z1Reset this instance.  Loses all unprocessed data.�z???N)�rawdata�lasttag�interesting_normal�interesting�
cdata_elemr�
ParserBaser$�rrrrr$�s
zHTMLParser.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�datarrr�feed�szHTMLParser.feedcCs|�d�dS)zHandle any buffered data.rN)r-r,rrr�close�szHTMLParser.closecCst||�����N)r	�getpos)r�messagerrr�error�szHTMLParser.errorNcCs|jS)z)Return full source of start tag: '<...>'.)�_HTMLParser__starttag_textr,rrr�get_starttag_text�szHTMLParser.get_starttag_textcCs$|��|_t�d|jtj�|_dS)Nz</\s*%s\s*>)�lowerr*�re�compile�Ir))r�elemrrr�set_cdata_mode�s
zHTMLParser.set_cdata_modecCst|_d|_dSr2)r(r)r*r,rrr�clear_cdata_mode�s
zHTMLParser.clear_cdata_modec
Cs�|j}d}t|�}||k�r�|j�||�}|r|��}n|jr!�n�|}||kr0|�|||��|�||�}||kr<�ng|j}|d|�r�t	�
||�rP|�|�}nG|d|�r[|�|�}n<|d|�rf|�
|�}n1|d|�rq|�|�}n&|d|�r�|jr|�|�}n|�|�}n|d|kr�|�d�|d}n�n|dkr�|s��n|jr�|�d�|�d	|d�}|dkr�|�d|d�}|dkr�|d}n|d7}|�|||��|�||�}n�|d
|��r$t�
||�}|�r|��dd�}	|�|	�|��}|d
|d��s|d}|�||�}q	d
||d�v�r#|�|dd��|�|d�}n|d|��r�t�
||�}|�rT|�d�}	|�|	�|��}|d
|d��sM|d}|�||�}q	t�
||�}|�r�|�r�|��||d�k�r�|j�ru|�d�n||k�r||}|�||d�}n|d|k�r�|�d�|�||d�}nnJd��||ks|�r�||k�r�|j�s�|�|||��|�||�}||d�|_dS)Nr�<�</�<!--�<?�<!rzEOF in middle of constructr�&#r����;�&z#EOF in middle of entity or char refzinteresting.search() lied)r&�lenr)�search�startr*�handle_data�	updatepos�
startswith�starttagopen�match�parse_starttag�parse_endtag�
parse_comment�parse_pir#�parse_declaration�parse_html_declarationr5�find�charref�group�handle_charref�end�	entityref�handle_entityref�
incomplete)
rrZr&�i�nrO�jrM�k�namerrrr-�s�









�




�\zHTMLParser.goaheadcCs�|j}|||d�dksJd��|||d�dkr |�|�S|||d�dkr/|�|�S|||d���d	krX|�d
|d�}|dkrIdS|�||d|��|dS|�|�S)
NrrCz+unexpected call to parse_html_declaration()�rA�z<![�	z	<!doctyperrEr)r&rR�parse_marked_sectionr8rV�handle_decl�parse_bogus_comment)rr^r&�gtposrrrrUs


z!HTMLParser.parse_html_declarationrcCs`|j}|||d�dvsJd��|�d|d�}|dkrdS|r,|�||d|��|dS)Nr)rCr@z"unexpected call to parse_comment()rrEr)r&rV�handle_comment)rr^�reportr&�posrrrrh-szHTMLParser.parse_bogus_commentcCsd|j}|||d�dksJd��t�||d�}|sdS|��}|�||d|��|��}|S)NrrBzunexpected call to parse_pi()rE)r&�picloserIrJ�	handle_pirZ)rr^r&rOr`rrrrS9szHTMLParser.parse_picCs"d|_|�|�}|dkr|S|j}|||�|_g}t�||d�}|s(Jd��|��}|�d���|_}||kr�|j	rDt
�||�}nt�||�}|sMnT|�ddd�\}	}
}|
s\d}n-|dd�dkrn|dd�ks�n|dd�dkr�|dd�kr�nn|dd�}|r�|�|�}|�
|	��|f�|��}||ks:|||���}|d	vr�|��\}
}d
|jvr�|
|j�d
�}
t|j�|j�d
�}n|t|j�}|j	r�|�d|||�dd�f�|�|||��|S|�d
�r�|�||�|S|�||�||jv�r|�|�|S)Nrrz#unexpected call to parse_starttag()rrd�'rE�")r�/>�
z junk characters in start tag: %r�rq)r6�check_for_whole_start_tagr&�tagfindrOrZrXr8r'r#�attrfind�attrfind_tolerant�unescape�append�stripr3�countrH�rfindr5rK�endswith�handle_startendtag�handle_starttag�CDATA_CONTENT_ELEMENTSr=)rr^�endposr&�attrsrOra�tag�m�attrname�rest�	attrvaluerZrrrrrrPEsd
&(
�

��
�
zHTMLParser.parse_starttagcCs|j}|jr
t�||�}nt�||�}|r}|��}|||d�}|dkr)|dS|dkrY|�d|�r7|dS|�d|�r?dS|jrO|�||d�|�d�||krU|S|dS|dkr_dS|d	vredS|jrs|�||�|�d
�||kry|S|dSt	d��)Nrr�/rqrrEzmalformed empty start tagr%z6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzmalformed start tagzwe should not get here!)
r&r#�locatestarttagendrO�locatestarttagend_tolerantrZrMrLr5�AssertionError)rr^r&r�r`�nextrrrrt~s>

z$HTMLParser.check_for_whole_start_tagcCsJ|j}|||d�dksJd��t�||d�}|sdS|��}t�||�}|s||jdur9|�|||��|S|jrH|�	d|||�f�t
�||d�}|se|||d�dkr`|dS|�|�S|���
�}|�d	|���}|�|�|dS|�d��
�}|jdur�||jkr�|�|||��|S|�|�
��|��|S)
Nrr@zunexpected call to parse_endtagrrEzbad end tag: %rrdz</>r)r&�	endendtagrIrZ�
endtagfindrOr*rKr#r5�tagfind_tolerantrhrXr8rV�
handle_endtagr>)rr^r&rOri�	namematch�tagnamer<rrrrQ�s<




zHTMLParser.parse_endtagcCs|�||�|�|�dSr2)rr��rr�r�rrrr~�szHTMLParser.handle_startendtagcC�dSr2rr�rrrr��zHTMLParser.handle_starttagcCr�r2r)rr�rrrr��r�zHTMLParser.handle_endtagcCr�r2r�rrbrrrrY�r�zHTMLParser.handle_charrefcCr�r2rr�rrrr\�r�zHTMLParser.handle_entityrefcCr�r2rr.rrrrK�r�zHTMLParser.handle_datacCr�r2rr.rrrrj�r�zHTMLParser.handle_commentcCr�r2r)r�declrrrrg�r�zHTMLParser.handle_declcCr�r2rr.rrrrn�r�zHTMLParser.handle_picCs|jr
|�d|f�dSdS)Nzunknown declaration: %r)r#r5r.rrr�unknown_decl�s�zHTMLParser.unknown_declcCs"d|vr|Sdd�}t�d||�S)NrGcSs�|��d}z-|ddkr2|dd�}|ddvr&t|dd��d�d�}nt|�d��}t|�WSWn
ty@d|YSwddlm}||vrO||S|�d�rXd	|Std
t	|��D]}|d|�|vry||d|�||d�Sq_d	|S)Nr�#r)�x�XrF�rD)�html5rGr)
�groups�int�rstrip�chr�
ValueError�future.backports.html.entitiesr�r}�rangerH)�s�cr�r�rrr�replaceEntities�s,
��
 �z,HTMLParser.unescape.<locals>.replaceEntitiesz&&(#?[xX]?(?:[0-9a-fA-F]+;|\w{1,32};?)))r9�sub)rr�r�rrrrx�s�zHTMLParser.unescape)F)r) rrrrr�rr$r0r1r5r6r7r=r>r-rUrhrSrPrtrQr~rr�rYr\rKrjrgrnr�rxrrrrrds<

	h
9+*r) r�
__future__rrrr�future.builtins�future.backportsrr9r r:r(r]r[rWrNrm�commentcloserur�rvrw�VERBOSEr�r�r�r��	Exceptionr	r+rrrrr�<module>s>








��
��



https://t.me/RX1948 - 2025