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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

,�]W?�@sXdZddlZe�d�jZe�d�jZe�d�Ze�d�Ze�d�Z[Gdd	�d	e	�Z
dS)
aShared support for scanning document type declarations in HTML and XHTML.

Backported for python-future from Python 3.3. Reason: ParserBase is an
old-style class in the Python 2.7 source of markupbase.py, which I suspect
might be the cause of sporadic unit-test failures on travis-ci.org with
test_htmlparser.py.  The test failures look like this:

    ======================================================================

ERROR: test_attr_entity_replacement (future.tests.test_htmlparser.AttributesStrictTestCase)

----------------------------------------------------------------------

Traceback (most recent call last):
  File "/home/travis/build/edschofield/python-future/future/tests/test_htmlparser.py", line 661, in test_attr_entity_replacement
    [("starttag", "a", [("b", "&><"'")])])
  File "/home/travis/build/edschofield/python-future/future/tests/test_htmlparser.py", line 93, in _run_check
    collector = self.get_collector()
  File "/home/travis/build/edschofield/python-future/future/tests/test_htmlparser.py", line 617, in get_collector
    return EventCollector(strict=True)
  File "/home/travis/build/edschofield/python-future/future/tests/test_htmlparser.py", line 27, in __init__
    html.parser.HTMLParser.__init__(self, *args, **kw)
  File "/home/travis/build/edschofield/python-future/future/backports/html/parser.py", line 135, in __init__
    self.reset()
  File "/home/travis/build/edschofield/python-future/future/backports/html/parser.py", line 143, in reset
    _markupbase.ParserBase.reset(self)

TypeError: unbound method reset() must be called with ParserBase instance as first argument (got EventCollector instance instead)

This module is used as a foundation for the html.parser module.  It has no
documented public API and should not be used directly.

�Nz[a-zA-Z][-_.a-zA-Z0-9]*\s*z(\'[^\']*\'|"[^"]*")\s*z--\s*>z	]\s*]\s*>z]\s*>c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdZ	d
d�Z
d#dd�Zd#dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)$�
ParserBaseziParser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers.cCs|jtur	td��dS)Nz)_markupbase.ParserBase must be subclassed)�	__class__r�RuntimeError��self�r�>/usr/lib/python3/dist-packages/future/backports/_markupbase.py�__init__6s

��zParserBase.__init__cCstd��)Nz.subclasses of ParserBase must override error())�NotImplementedError)r�messagerrr�error;s�zParserBase.errorcCsd|_d|_dS)N�r��lineno�offsetrrrr�reset?s
zParserBase.resetcCs|j|jfS)z&Return current line number and offset.rrrrr�getposCszParserBase.getposcCsd||kr|S|j}|�d||�}|r(|j||_|�d||�}||d|_|S|j|||_|S)N�
r
)�rawdata�countr�rindexr)r�i�jr�nlines�posrrr�	updateposKs�zParserBase.updatepos�c
Cs�|j}|d}|||�dksJd��|||d�dkr!|dS|||d�dvr-dSt|�}|||d�dkr@|�|�S||d	krK|�|�S|�||�\}}|d
krY|S|dkr`d|_||kr�||}|dkr�||d|�}|dkr�|�|�|dS|�|�|dS|d
vr�t||�}|s�dS|�	�}nG|dvr�|�||�\}	}n:||jvr�|d}n0|d	kr�|dkr�|�
|d|�}n|tgd��vr�|�d|�n|�d�n	|�d||�|d
kr�|S||ksddS)N��<!z$unexpected call to parse_declarationr
�>)�-r���z--�[r�doctyperz"'�4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ)�attlist�linktype�link�elementz&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)
r�len�
parse_comment�parse_marked_section�
_scan_name�_decl_otherchars�handle_decl�unknown_decl�_declstringlit_match�end�_parse_doctype_subset�setr)
rrrr�n�decltype�c�data�m�namerrr�parse_declaration[s`



�




��(zParserBase.parse_declarationr
cCs�|j}|||d�dksJd��|�|d|�\}}|dkr!|S|tgd��vr2t�||d�}n|tgd��vrCt�||d�}n
|�d||d|��|sTdS|rf|�d�}|�||d|��|�	d�S)	N�z<![z)unexpected call to parse_marked_section()r)�temp�cdata�ignore�include�rcdata)�if�else�endifz+unknown status keyword %r in marked sectionr!)
rr,r3�_markedsectionclose�search�_msmarkedsectioncloser�startr/r1)rr�reportr�sectNamer�matchrrrr+�s 

zParserBase.parse_marked_sectioncCsj|j}|||d�dkr|�d�t�||d�}|sdS|r0|�d�}|�||d|��|�d�S)N��<!--z"unexpected call to parse_comment()r!r)rr�
_commentcloserErG�handle_commentr1)rrrHrrJrrrrr*�s


zParserBase.parse_commentc
Cs.|j}t|�}|}||k�r||}|dkr�|||d�}|dkr$dS|dkr7|�||d�|�d|�|d|kr?dS|d|krGdS|||d�dkr_|j|d	d
�}|d	kr^|Sq	|�|d|�\}}|dkrodS|tgd��vr�|�||d�|�d|�t|d
|�}	|	||�}|d	kr�|Snx|dkr�|d|kr�dS|�|d|�\}}|d	kr�|S||dkr�|d}nQ|dkr�|d}||kr�||��r�|d}||kr�||��s�||kr�||dkr�|S|�||�|�d�ndS|���r|d}n
|�||�|�d|�||ksdS)N�<rr!rr
z*unexpected char in internal subset (in %r)rKrLr)rH)r%r(�entity�notationz)unknown declaration %r in internal subset�_parse_doctype_�%�;�]rz%unexpected char after internal subsetz%unexpected char %r in internal subset)	rr)rrr*r,r3�getattr�isspace)
rr�declstartposrr4rr6�sr9�methrrrr2�sx
�
���

�<z ParserBase._parse_doctype_subsetcCsF|�||�\}}|dkrdS|j}d||d�vr!|�d|�dSdS)Nr!rr
)r,r�find)rrrXr9rrrrr�_parse_doctype_elementsz!ParserBase._parse_doctype_elementcCs�|j}|�||�\}}|||d�}|dkrdS|dkr!|dS	|�||�\}}|dkr0|S|||d�}|dkr>dS|dkrvd||d�vrS|�d|�d}ndS|||d���rm|d}|||d���s_||d�sudSn|�||�\}}|||d�}|s�dS|dvr�t||�}|r�|��}ndS|||d�}|s�dS|d	kr�||d�d	kr�dS|�|d|�\}}|dkr�|S|||d�}|s�dS|dkr�|dSq")
Nr
rr!rr�(�)�'"�#)rr,r[rWr0r1)rrrXrr9rr6r8rrr�_parse_doctype_attlists`��

�z!ParserBase._parse_doctype_attlistcCs�|�||�\}}|dkr|S|j}	|||d�}|sdS|dkr&|dS|dvr8t||�}|s3dS|��}n|�||�\}}|dkrF|Sq)Nrr
r!rr_)r,rr0r1)rrrXr9rrr6r8rrr�_parse_doctype_notationXs&

�z"ParserBase._parse_doctype_notationcCs�|j}|||d�dkr*|d}	|||d�}|sdS|��r'|d}nnqn|}|�||�\}}|dkr:|S	|j||d�}|sHdS|dvrZt||�}|rX|��}ndS|dkrb|dS|�||�\}}|dkrp|Sq;)Nr
rSr!rr_r)rrWr,r0r1)rrrXrrr6r9r8rrr�_parse_doctype_entityos>
�

�z ParserBase._parse_doctype_entitycCs�|j}t|�}||kr
dSt||�}|r.|��}|��}|t|�|kr&dS|��|��fS|�||�|�d|||d��dS)N)Nr!zexpected name token at %r�)	rr)�_declname_match�group�strip�lowerr1rr)rrrXrr4r8rYr9rrrr,�s

�zParserBase._scan_namecCsdS)Nr)rr7rrrr/�szParserBase.unknown_declN)r
)�__name__�
__module__�__qualname__�__doc__r	rrrrr-r:r+r*r2r\rarbrcr,r/rrrrr2s$

R
C9$r)rl�re�compilerJrer0rMrDrF�objectrrrrr�<module>s"




https://t.me/RX1948 - 2025