ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/html/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/html/__pycache__/parser.cpython-311.opt-2.pyc

�

�f�B����	ddlZddlZddlmZdgZejd��Zejd��Zejd��Zejd��Z	ejd��Z
ejd	��Zejd
��Zejd��Z
ejd��Zejd
ej��Zejd	��Zejd��ZGd�dej��ZdS)�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��eZdZ	dZdd�d�Zd�Zd�Zd�ZdZd	�Z	d
�Z
d�Zd�Zd
�Z
dd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)r)�script�styleT)�convert_charrefsc�>�	||_|���dS�N)r	�reset)�selfr	s  �2/opt/alt/python311/lib64/python3.11/html/parser.py�__init__zHTMLParser.__init__Vs"��	�
!1����
�
������c��	d|_d|_t|_d|_t
j�|��dS)N�z???)�rawdata�lasttag�interesting_normal�interesting�
cdata_elem�_markupbase�
ParserBaser�r
s rrzHTMLParser.reset_s?��?�������-��������$�$�T�*�*�*�*�*rc�P�	|j|z|_|�d��dS)Nr)r�goahead�r
�datas  r�feedzHTMLParser.feedgs*��	�
�|�d�*������Q�����rc�2�	|�d��dS)N�)rrs r�closezHTMLParser.closeps��'����Q�����rNc��	|jSr)�_HTMLParser__starttag_textrs r�get_starttag_textzHTMLParser.get_starttag_textvs��7��#�#rc��|���|_tjd|jztj��|_dS)Nz</\s*%s\s*>)�lowerr�re�compile�Ir)r
�elems  r�set_cdata_modezHTMLParser.set_cdata_modezs4���*�*�,�,����:�n�t��&F���M�M����rc�,�t|_d|_dSr)rrrrs r�clear_cdata_modezHTMLParser.clear_cdata_mode~s��-�������rc��|j}d}t|��}||k�r|jr}|jsv|�d|��}|dkrY|�dt
||dz
����}|dkr*tjd���	||��s�n�|}n=|j
�	||��}|r|���}n|jr�nZ|}||krV|jr2|js+|�t|||�����n|�|||���|�||��}||kr�n�|j}|d|���r�t �||��r|�|��}	n�|d|��r|�|��}	n�|d|��r|�|��}	nj|d|��r|�|��}	nH|d	|��r|�|��}	n&|d
z|kr|�d��|d
z}	n�n�|	dkr�|s�n�|�d|d
z��}	|	dkr%|�d|d
z��}	|	dkr|d
z}	n|	d
z
}	|jr2|js+|�t|||	�����n|�|||	���|�||	��}�n#|d|��r�t.�||��}|rq|���d
d�}
|�|
��|���}	|d|	d
z
��s|	d
z
}	|�||	��}���d||d�vr9|�|||d
z���|�||d
z��}�nI|d|���r5t6�||��}|rj|�d
��}
|�|
��|���}	|d|	d
z
��s|	d
z
}	|�||	��}��kt:�||��}|rX|rU|���||d�kr5|���}	|	|kr|}	|�||d
z��}n@|d
z|kr/|�d��|�||d
z��}nn||k��|ry||krs|jsl|jr2|js+|�t|||�����n|�|||���|�||��}||d�|_dS)Nr�<�&�"z[\s;]z</�<!--z<?z<!r!rz&#�����;)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)r
rJr�i�n�j�ampposrAr?�k�names           rrzHTMLParser.goahead�s)���,��
����L�L���!�e�e��$�
�T�_�
��L�L��a�(�(���q�5�5�%�]�]�3��A�q��t���=�=�F��!����J�x�0�0�7�7���H�H�$���A���(�/�/���;�;�������
�
�A�A������A��1�u�u��(�3���3��$�$�X�g�a��c�l�%;�%;�<�<�<�<��$�$�W�Q�q�S�\�2�2�2����q�!�$�$�A��A�v�v�u� �+�J��z�#�q�!�!�J
6��%�%�g�q�1�1���+�+�A�.�.�A�A��Z��a�(�(���)�)�!�,�,�A�A��Z���*�*�
��*�*�1�-�-�A�A��Z��a�(�(���
�
�a�(�(�A�A��Z��a�(�(���3�3�A�6�6�A�A��!�e�q�[�[��$�$�S�)�)�)��A��A�A���q�5�5�������S�!�a�%�0�0�A��1�u�u�#�L�L��a�!�e�4�4���q�5�5� !�A��A���Q����,�7�T�_�7��(�(��'�!�A�#�,�)?�)?�@�@�@�@��(�(���1���6�6�6��N�N�1�a�(�(�����D�!�$�$�+
6��
�
�g�q�1�1���� �;�;�=�=��2��.�D��'�'��-�-�-��	�	���A�%�:�c�1�Q�3�/�/�"���E�����q�!�,�,�A���g�a�b�b�k�)�)��(�(���1�Q�3���8�8�8� �N�N�1�a��c�2�2�����C��#�#�
6�!�����3�3���� �;�;�q�>�>�D��)�)�$�/�/�/��	�	���A�%�:�c�1�Q�3�/�/�"���E�����q�!�,�,�A��"�(�(��!�4�4�����5�u�{�{�}�}������;�;�!�I�I�K�K����6�6� !�A� �N�N�1�a�!�e�4�4����!�e�q�[�[��$�$�S�)�)�)����q�!�a�%�0�0�A�A��O�!�e�e�V�	%�1�q�5�5���5��$�
/�T�_�
/�� � ��'�!�A�#�,�!7�!7�8�8�8�8�� � ���1���.�.�.����q�!�$�$�A��q�r�r�{����rc��|j}|||dz�dkr|�|��S|||dz�dkr|�|��S|||dz����dkrF|�d|dz��}|dkrdS|�||d	z|���|d
zS|�|��S)N�r3�z<![�	z	<!doctyperr5r4r!)rrD�parse_marked_sectionr'r8�handle_decl�parse_bogus_comment)r
rNr�gtposs    rrFz!HTMLParser.parse_html_declaration�s����,���1�Q�q�S�5�>�V�#�#��%�%�a�(�(�(�
�Q�q��s�U�^�u�
$�
$��,�,�Q�/�/�/�
�Q�q��s�U�^�
!�
!�
#�
#�{�
2�
2��L�L��a��c�*�*�E���{�{��r����W�Q�q�S��Y�/�0�0�0���7�N��+�+�A�.�.�.rr!c��|j}|�d|dz��}|dkrdS|r |�||dz|���|dzS)Nrr4r5r!)rr8�handle_comment)r
rN�reportr�poss     rrZzHTMLParser.parse_bogus_commentsb���,���l�l�3��!��$�$���"�9�9��2��	2������!��C�� 0�1�1�1��Q�w�rc���|j}t�||dz��}|sdS|���}|�||dz|���|���}|S)Nr4r5)r�picloser;r<�	handle_pirJ)r
rNrrArPs     rrEzHTMLParser.parse_pi sj���,�����w��!��,�,���	��2��K�K�M�M�����w�q��s�A�v��'�'�'��I�I�K�K���rc�>�d|_|�|��}|dkr|S|j}|||�|_g}t�||dz��}|���}|�d�����x|_}||kr�t�||��}|sn�|�ddd��\}	}
}|
sd}nI|dd�dcxkr|dd�ks"n|dd�dcxkr|dd�kr
nn
|dd�}|rt|��}|�|	���|f��|���}||k��|||����}|dvr|�
|||���|S|�d	��r|�||��n4|�||��||jvr|�|��|S)
Nrr!r4rV�'r5�")r�/>rf)r$�check_for_whole_start_tagr�tagfind_tolerantrArJrHr'r�attrfind_tolerantr�append�stripr=�endswith�handle_startendtag�handle_starttag�CDATA_CONTENT_ELEMENTSr,)
r
rN�endposr�attrsrArR�tag�m�attrname�rest�	attrvaluerJs
             rrBzHTMLParser.parse_starttag,sU��#����/�/��2�2���A�:�:��M��,��&�q��x�0����� �&�&�w��!��4�4���I�I�K�K��"�[�[��^�^�1�1�3�3�3���s��&�j�j�!�'�'���3�3�A��
��()����1�a�(8�(8�%�H�d�I��
,� �	�	��2�A�2��$�8�8�8�8�)�B�C�C�.�8�8�8�8��2�A�2��#�7�7�7�7��2�3�3��7�7�7�7�7�%�a��d�O�	��
0�$�Y�/�/�	��L�L�(�.�.�*�*�I�6�7�7�7������A��&�j�j��a��h��%�%�'�'���k�!�!����W�Q�v�X�.�/�/�/��M��<�<����	)��#�#�C��/�/�/�/�� � ��e�,�,�,��d�1�1�1��#�#�C�(�(�(��
rc��|j}t�||��}|r�|���}|||dz�}|dkr|dzS|dkr@|�d|��r|dzS|�d|��rdS||kr|S|dzS|dkrdS|dvrdS||kr|S|dzStd	���)
Nr!r�/rfr4r5rz6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzwe should not get here!)r�locatestarttagend_tolerantrArJr?�AssertionError)r
rNrrsrP�nexts      rrgz$HTMLParser.check_for_whole_start_tagXs���,��&�,�,�W�a�8�8���	������A��1�Q�q�S�5�>�D��s�{�{��1�u���s�{�{��%�%�d�A�.�.�!��q�5�L��%�%�c�1�-�-���2��q�5�5��H��q�5�L��r�z�z��r��5�6�6��r��1�u�u����1�u���6�7�7�7rc�p�|j}t�||dz��}|sdS|���}t�||��}|s�|j�|�|||���|St�||dz��}|s+|||dz�dkr|dzS|�	|��S|�
d�����}|�d|�����}|�
|��|dzS|�
d�����}|j�*||jkr|�|||���|S|�
|��|���|S)Nr!r5r4rVz</>r)r�	endendtagr;rJ�
endtagfindrArr=rhrZrHr'r8�
handle_endtagr.)r
rNrrAr[�	namematch�tagnamer+s        rrCzHTMLParser.parse_endtagzs����,��� � ��!�A�#�.�.���	��2��	�	����� � ��!�,�,���	���*�� � ���5��!1�2�2�2���(�.�.�w��!��<�<�I��
7��1�Q�q�S�5�>�U�*�*��Q�3�J��3�3�A�6�6�6��o�o�a�(�(�.�.�0�0�G�
�L�L��i�m�m�o�o�6�6�E����w�'�'�'���7�N��{�{�1�~�~�#�#�%�%���?�&��t��&�&�� � ���5��!1�2�2�2������4� � � ��������rc�\�|�||��|�|��dSr)rnr�r
rrrqs   rrmzHTMLParser.handle_startendtag�s2�����S�%�(�(�(����3�����rc��dSr�r�s   rrnzHTMLParser.handle_starttag�����rc��dSrr�)r
rrs  rrzHTMLParser.handle_endtag�r�rc��dSrr��r
rSs  rrIzHTMLParser.handle_charref�r�rc��dSrr�r�s  rrLzHTMLParser.handle_entityref�r�rc��dSrr�rs  rr=zHTMLParser.handle_data�r�rc��dSrr�rs  rr]zHTMLParser.handle_comment�r�rc��dSrr�)r
�decls  rrYzHTMLParser.handle_decl�r�rc��dSrr�rs  rrbzHTMLParser.handle_pi�r�rc��dSrr�rs  r�unknown_declzHTMLParser.unknown_decl�r�r)r!)�__name__�
__module__�__qualname__rorrrr"r$r%r,r.rrFrZrErBrgrCrmrnrrIrLr=r]rYrbr�r�rrrr>s��������*1��+/������+�+�+��������O�$�$�$�N�N�N����u#�u#�u#�t/�/�/�*	�	�	�	�	�	�	�(�(�(�X8�8�8�D%�%�%�P � � �

�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
r)r(r�htmlr�__all__r)rrMrKrGr@ra�commentcloserhri�VERBOSEryr}r~rrr�rr�<module>r�sj��"�
�	�	�	������������.�� �R�Z��'�'��
�R�Z��
%�
%�
��B�J�>�?�?�	�
�"�*�@�
A�
A���r�z�+�&�&��
�"�*�S�/�/���r�z�)�$�$���2�:�L�M�M���B�J�=�>�>��(�R�Z�)��Z����
�B�J�s�O�O�	��R�Z�>�
?�
?�
�I
�I
�I
�I
�I
��'�I
�I
�I
�I
�I
r

Zerion Mini Shell 1.0