%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.12/html/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.12/html/__pycache__/parser.cpython-312.pyc

�

���f�B���dZddlZddlZddlmZdgZejd�Zejd�Zejd�Z	ejd�Z
ejd	�Zejd
�Zejd�Z
ejd�Zejd
�Zejdej �Zejd
�Zejd�ZGd�dej(�Zy)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--\s*>z+([a-zA-Z][^\t\n\r\f />\x00]*)(?:\s|/(?!>))*z]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*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���eZdZdZdZdd��fd�
Z�fd�Zd�Zd�Zd	Z	d
�Z
d�Zd�Zd
�Z
d�Zdd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z�xZS)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.
    )�script�styleT)�convert_charrefsc�P��t�|��||_|j�y)z�Initialize and reset this instance.

        If convert_charrefs is True (the default), all character references
        are automatically converted to the corresponding Unicode characters.
        N)�super�__init__r	�reset)�selfr	�	__class__s  ��"/usr/lib/python3.12/html/parser.pyrzHTMLParser.__init__Vs!���	���� 0����
�
��c�b��d|_d|_t|_d|_t
�|��y)z1Reset this instance.  Loses all unprocessed data.�z???N)�rawdata�lasttag�interesting_normal�interesting�
cdata_elemrr
)rrs �rr
zHTMLParser.reset`s)���������-������
��
�rc�N�|j|z|_|jd�y)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�datas  r�feedzHTMLParser.feedhs���|�|�d�*������Q�rc�&�|jd�y)zHandle any buffered data.�N)r�rs r�closezHTMLParser.closeqs
�����Q�rNc��|jS)z)Return full source of start tag: '<...>'.)�_HTMLParser__starttag_textr s r�get_starttag_textzHTMLParser.get_starttag_textws���#�#�#rc��|j�|_tjd|jztj�|_y)Nz</\s*%s\s*>)�lowerr�re�compile�Ir)r�elems  r�set_cdata_modezHTMLParser.set_cdata_mode{s/���*�*�,����:�:�n�t���&F����M��rc�(�t|_d|_y�N)rrrr s r�clear_cdata_modezHTMLParser.clear_cdata_modes��-�����rc��	�|j}d}t|�}||k�rW|jrq|jse|j	d|�}|dkr�|jdt
||dz
��}|dk\r'tjd�j||�s�n�|}n?|jj||�}|r|j�}n|jr�n�|}||krJ|jr*|js|jt|||��n|j|||�|j||�}||k(r�n3|j}|d|��r[t j#||�r|j%|�}	n�|d|�r|j'|�}	nr|d|�r|j)|�}	nW|d|�r|j+|�}	n<|d	|�r|j-|�}	n!|d
z|kr|jd�|d
z}	n�nh|	dkr�|s�n_|j	d|d
z�}	|	dkr |j	d|d
z�}	|	dkr|d
z}	n|	d
z
}	|jr*|js|jt|||	��n|j|||	�|j||	�}�n�|d|�r�t.j#||�}|rY|j1�d
d}
|j3|
�|j5�}	|d|	d
z
�s|	d
z
}	|j||	�}��d||dvr,|j|||d
z�|j||d
z�}�n|d|�r�t6j#||�}|rW|j1d
�}
|j9|
�|j5�}	|d|	d
z
�s|	d
z
}	|j||	�}���t:j#||�}|rE|rB|j1�||dk(r,|j5�}	|	|kr|}	|j||d
z�}n>|d
z|kr'|jd�|j||d
z�}nnJd��||kr��W|rm||krh|js\|jr*|js|jt|||��n|j|||�|j||�}||d|_y)Nr�<�&�"z[\s;]�</�<!--�<?�<!rrz&#�����;zinteresting.search() lied)r�lenr	r�find�rfind�maxr'r(�searchr�start�handle_datar�	updatepos�
startswith�starttagopen�match�parse_starttag�parse_endtag�
parse_comment�parse_pi�parse_html_declaration�charref�group�handle_charref�end�	entityref�handle_entityref�
incomplete)rrMr�i�n�j�ampposrDrB�k�names           rrzHTMLParser.goahead�s����,�,��
����L���!�e��$�$�T�_�_��L�L��a�(���q�5�%�]�]�3��A�q��t��=�F��!���J�J�x�0�7�7���H���A��(�(�/�/���;������
�A������A��1�u��(�(�����$�$�X�g�a��l�%;�<��$�$�W�Q�q�\�2����q�!�$�A��A�v�u� �+�+�J��#�q�!��%�%�g�q�1��+�+�A�.�A���a�(��)�)�!�,�A����*��*�*�1�-�A���a�(��
�
�a�(�A���a�(��3�3�A�6�A��!�e�q�[��$�$�S�)��A��A���q�5������S�!�a�%�0�A��1�u�#�L�L��a�!�e�4���q�5� !�A��A��Q����,�,�T�_�_��(�(��'�!�A�,�)?�@��(�(���1��6��N�N�1�a�(���D�!�$��
�
�g�q�1��� �;�;�=��2�.�D��'�'��-��	�	��A�%�c�1�Q�3�/���E�����q�!�,�A���g�a�b�k�)��(�(���1�Q�3��8� �N�N�1�a��c�2����C��#�!�����3��� �;�;�q�>�D��)�)�$�/��	�	��A�%�c�1�Q�3�/���E�����q�!�,�A��"�(�(��!�4����u�{�{�}�����;�!�I�I�K����6� !�A� �N�N�1�a�!�e�4����!�e�q�[��$�$�S�)����q�!�a�%�0�A��5�5�5�q�S�!�e�V�1�q�5�����$�$�T�_�_�� � ��'�!�A�,�!7�8�� � ���1��.����q�!�$�A��q�r�{��rc�p�|j}|||dzdk(sJd��|||dzdk(r|j|�S|||dzdk(r|j|�S|||dzj�d	k(r7|j	d
|dz�}|dk(ry|j||dz|�|dzS|j
|�S)
Nr7r6z+unexpected call to parse_html_declaration()�r4�z<![�	z	<!doctyperr8r)rrG�parse_marked_sectionr&r;�handle_decl�parse_bogus_comment)rrQr�gtposs    rrIz!HTMLParser.parse_html_declarations����,�,���q��1��~��%�	D�)C�	D�%��1�Q�q�S�>�V�#��%�%�a�(�(�
�Q�q��s�^�u�
$��,�,�Q�/�/�
�Q�q��s�^�
!�
!�
#�{�
2��L�L��a��c�*�E���{�����W�Q�q�S��/�0���7�N��+�+�A�.�.rc��|j}|||dzdvsJd��|jd|dz�}|dk(ry|r|j||dz|�|dzS)Nr7)r6r3z"unexpected call to parse_comment()rr8r)rr;�handle_comment)rrQ�reportr�poss     rr]zHTMLParser.parse_bogus_commentsu���,�,���q��1��~��-�	C�1B�	C�-��l�l�3��!��$���"�9��������!��C� 0�1��Q�w�rc���|j}|||dzdk(sJd��tj||dz�}|sy|j�}|j	||dz|�|j�}|S)Nr7r5zunexpected call to parse_pi()r8)r�picloser>r?�	handle_pirM)rrQrrDrSs     rrHzHTMLParser.parse_pi!st���,�,���q��1��~��%�F�'F�F�%����w��!��,�����K�K�M�����w�q��s�A��'��I�I�K���rc�~�d|_|j|�}|dkr|S|j}||||_g}tj	||dz�}|sJd��|j�}|j
d�j�x|_}||kr�tj	||�}|sn�|j
ddd�\}	}
}|
sd}n,|dddcxk(r|ddk(sn|dddcxk(r|ddk(rnn|dd}|rt|�}|j|	j�|f�|j�}||kr��|||j�}|d	vr|j|||�|S|jd
�r|j||�|S|j!||�||j"vr|j%|�|S)Nrrz#unexpected call to parse_starttag()r7rY�'r8�")r�/>ri)r#�check_for_whole_start_tagr�tagfind_tolerantrDrMrKr&r�attrfind_tolerantr�append�stripr@�endswith�handle_startendtag�handle_starttag�CDATA_CONTENT_ELEMENTSr+)
rrQ�endposr�attrsrDrU�tag�m�attrname�rest�	attrvaluerMs
             rrEzHTMLParser.parse_starttag-s���#����/�/��2���A�:��M��,�,��&�q��0����� �&�&�w��!��4���;�;�;�u��I�I�K��"�[�[��^�1�1�3�3���s��&�j�!�'�'���3�A���()����1�a�(8�%�H�d�I�� �	��2�A��$�8�)�B�C�.�8��2�A��#�7��2�3��7�%�a��O�	��$�Y�/�	��L�L�(�.�.�*�I�6�7�����A��&�j��a���%�%�'���k�!����W�Q�v�.�/��M��<�<����#�#�C��/�
�
�
� � ��e�,��d�1�1�1��#�#�C�(��
rc�H�|j}tj||�}|rt|j�}|||dz}|dk(r|dzS|dk(r6|j	d|�r|dzS|j	d|�ry||kDr|S|dzS|dk(ry|dvry||kDr|S|dzStd	��)
Nrr�/rir7r8rz6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzwe should not get here!)r�locatestarttagend_tolerantrDrMrB�AssertionError)rrQrrvrS�nexts      rrjz$HTMLParser.check_for_whole_start_tagYs����,�,��&�,�,�W�a�8�������A��1�Q�q�S�>�D��s�{��1�u���s�{��%�%�d�A�.��q�5�L��%�%�c�1�-���q�5��H��q�5�L��r�z���5�6���1�u����1�u���6�7�7rc��|j}|||dzdk(sJd��tj||dz�}|sy|j�}tj||�}|s�|j�|j|||�|Stj||dz�}|s!|||dzdk(r|dzS|j|�S|jd�j�}|jd|j��}|j|�|dzS|jd�j�}|j�%||jk7r|j|||�|S|j|�|j�|S)	Nr7r3zunexpected call to parse_endtagrr8rYz</>r)r�	endendtagr>rM�
endtagfindrDrr@rkr]rKr&r;�
handle_endtagr.)rrQrrDr^�	namematch�tagnamer*s        rrFzHTMLParser.parse_endtag{sy���,�,���q��1��~��%�H�'H�H�%�� � ��!�A�#�.�����	�	���� � ��!�,������*�� � ���5�!1�2���(�.�.�w��!��<�I���1�Q�q�S�>�U�*��Q�3�J��3�3�A�6�6��o�o�a�(�.�.�0�G�
�L�L��i�m�m�o�6�E����w�'���7�N��{�{�1�~�#�#�%���?�?�&��t���&�� � ���5�!1�2������4� ������rc�J�|j||�|j|�yr-)rqr��rrurts   rrpzHTMLParser.handle_startendtag�s �����S�%�(����3�rc��yr-�r�s   rrqzHTMLParser.handle_starttag����rc��yr-r�)rrus  rr�zHTMLParser.handle_endtag�r�rc��yr-r��rrVs  rrLzHTMLParser.handle_charref�r�rc��yr-r�r�s  rrOzHTMLParser.handle_entityref�r�rc��yr-r�rs  rr@zHTMLParser.handle_data�r�rc��yr-r�rs  rr`zHTMLParser.handle_comment�r�rc��yr-r�)r�decls  rr\zHTMLParser.handle_decl�r�rc��yr-r�rs  rrezHTMLParser.handle_pi�r�rc��yr-r�rs  r�unknown_declzHTMLParser.unknown_decl�r�r)r)�__name__�
__module__�__qualname__�__doc__rrrr
rr!r#r$r+r.rrIr]rHrErjrFrprqr�rLrOr@r`r\rer��
__classcell__)rs@rrr>s�����*1��+/������O�$�N��u#�t/�*	�	�(�X8�D%�P �

�
�
�
�
�
�
�
�
r)r�r'�_markupbase�htmlr�__all__r(rrPrNrJrCrd�commentcloserkrl�VERBOSEr|r�r��
ParserBaserr�rr�<module>r�s��"�
����.�� �R�Z�Z��'��
�R�Z�Z��
%�
��B�J�J�>�?�	�
�"�*�*�@�
A���r�z�z�+�&��
�"�*�*�S�/���r�z�z�)�$���2�:�:�L�M���B�J�J�=�>��(�R�Z�Z�)��Z�Z���
�B�J�J�s�O�	��R�Z�Z�>�
?�
�J
��'�'�J
r

Zerion Mini Shell 1.0