Your IP : 3.129.253.186


Current Path : /opt/alt/python313/lib64/python3.13/html/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/html/__pycache__/parser.cpython-313.opt-1.pyc

�

1}g�B���SrSSKrSSKrSSKJr S/r\R"S5r\R"S5r\R"S5r	\R"S5r
\R"S	5r\R"S
5r\R"S5r
\R"S5r\R"S
5r\R"S\R 5r\R"S
5r\R"S5r"SS\R(5rg)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��^�\rSrSrSrSrSS.U4SjjrU4SjrSrS	r	S
r
SrSrS
r
SrSrS SjrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrU=r $)!r�>aFind 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�N>�[TU]5 XlUR5 g)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  ��2/opt/alt/python313/lib64/python3.13/html/parser.pyr
�HTMLParser.__init__Vs���	���� 0���
�
��c�b>�SUlSUl[UlSUl[
TU]5 g)z1Reset this instance.  Loses all unprocessed data.�z???N)�rawdata�lasttag�interesting_normal�interesting�
cdata_elemrr)rrs �rr�HTMLParser.reset`s)���������-������
��
�rc�N�URU-UlURS5 g)zyFeed 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�feed�HTMLParser.feedhs���|�|�d�*������Q�rc�&�URS5 g)zHandle any buffered data.�N)r�rs r�close�HTMLParser.closeqs
�����Q�rNc��UR$)z)Return full source of start tag: '<...>'.)�_HTMLParser__starttag_textr$s r�get_starttag_text�HTMLParser.get_starttag_textws���#�#�#rc��UR5Ul[R"SUR-[R5Ulg)Nz</\s*%s\s*>)�lowerr�re�compile�Ir)r�elems  r�set_cdata_mode�HTMLParser.set_cdata_mode{s/���*�*�,����:�:�n�t���&F����M��rc�(�[UlSUlg�N)rrrr$s r�clear_cdata_mode�HTMLParser.clear_cdata_modes��-�����rc��
�URnSn[U5nX4:Ga�UR(a|UR(dkUR	SU5nUS:aRURS[
X4S-
55nUS:�a,[R"S5RX&5(dGO8UnOHURRX#5nU(aUR5nOUR(aGO�UnX5:aRUR(a.UR(dUR[X#U55 OURX#U5 URX55nX4:XaGO~URnU"SU5(Ga�[ R#X#5(aUR%U5n	O�U"SU5(aUR'U5n	O�U"SU5(aUR)U5n	ObU"SU5(aUR+U5n	OBU"S	U5(aUR-U5n	O"US
-U:aURS5 US
-n	OGO�U	S:a�U(dGO�UR	SUS
-5n	U	S:a!UR	SUS
-5n	U	S:aUS
-n	OU	S
-
n	UR(a.UR(dUR[X#U	55 OURX#U	5 URX95nGO�U"SU5(a�[.R#X#5nU(a^UR15S
Sn
UR3U
5 UR55n	U"SU	S
-
5(dU	S
-
n	URX95nGMpSX#S;a*URX#US
-5 URX3S
-5nGO$U"SU5(Ga
[6R#X#5nU(a\UR1S
5n
UR9U
5 UR55n	U"SU	S
-
5(dU	S
-
n	URX95nGM+[:R#X#5nU(aIU(aAUR15X#S:Xa+UR55n	X�::aUn	URX3S
-5nO8US
-U:a&URS5 URX3S
-5nOOX4:aGM�U(ayX4:atUR(dcUR(a.UR(dUR[X#U55 OURX#U5 URX45nX#SUlg)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)rrRr�i�n�j�ampposrIrG�k�names           rr�HTMLParser.goahead�s}���,�,��
����L���e��$�$�T�_�_��L�L��a�(���q�5�%�]�]�3��A��t��=�F��!���J�J�x�0�7�7��H�H���A���(�(�/�/��;������
�A������A��u��(�(�����$�$�X�g��l�%;�<��$�$�W�q�\�2����q�$�A��v�u� �+�+�J��#�q�!�!��%�%�g�1�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�(���D�!�$�$��
�
�g�1��� �;�;�=��2�.�D��'�'��-��	�	��A�%�c�1�Q�3�/�/���E�����q�,�A���g�b�k�)��(�(��1�Q�3��8� �N�N�1��c�2����C��#�#�!����3��� �;�;�q�>�D��)�)�$�/��	�	��A�%�c�1�Q�3�/�/���E�����q�,�A��"�(�(��4����u�{�{�}����;�!�I�I�K���6� !�A� �N�N�1�!�e�4����!�e�q�[��$�$�S�)����q�a�%�0�A��O�e�V�1�5�����$�$�T�_�_�� � ��'�A�,�!7�8�� � ��1��.����q�$�A��r�{��rc�L�URnX!US-S:XaURU5$X!US-S:XaURU5$X!US-R5S:Xa7UR	SUS-5nUS:XagURX!S	-U5 US
-$UR
U5$)N�r;�z<![�	z	<!doctyperr=r<r#)rrL�parse_marked_sectionr,r@�handle_decl�parse_bogus_comment)rrVr�gtposs    rrN�!HTMLParser.parse_html_declarations����,�,���Q�q�S�>�V�#��%�%�a�(�(�
�q��s�^�u�
$��,�,�Q�/�/�
�q��s�^�
!�
!�
#�{�
2��L�L��a��c�*�E���{�����W�q�S��/�0���7�N��+�+�A�.�.rc��URnURSUS-5nUS:XagU(aURX1S-U5 US-$)Nrr<r=r#)rr@�handle_comment)rrV�reportr�poss     rrc�HTMLParser.parse_bogus_commentsN���,�,���l�l�3��!��$���"�9�������!��C� 0�1��Q�w�rc���URn[RX!S-5nU(dgUR5nUR	X!S-U5 UR5nU$)Nr<r=)r�picloserCrD�	handle_pirR)rrVrrIrXs     rrM�HTMLParser.parse_pi!sR���,�,�����w�!��,�����K�K�M�����w��s�A��'��I�I�K���rc��SUlURU5nUS:aU$URnX1UUl/n[R	X1S-5nUR5nUR
S5R5=UlnXb:a�[R	X65nU(dO�UR
SSS5up�nU
(dSnO0USSSs=:Xa	USS:XdO USSSs=:Xa	USS:XaO OUSSnU(a[U5nURU	R5U45 UR5nXb:aM�X6UR5nUS;aURX1U5 U$URS	5(aURXt5 U$UR!Xt5 XpR";aUR%U5 U$)
Nrr#r<r_�'r=�")r�/>rr)r(�check_for_whole_start_tagr�tagfind_tolerantrIrRrPr,r�attrfind_tolerantr�append�striprE�endswith�handle_startendtag�handle_starttag�CDATA_CONTENT_ELEMENTSr1)
rrV�endposr�attrsrIrZ�tag�m�attrname�rest�	attrvaluerRs
             rrJ�HTMLParser.parse_starttag-s���#����/�/��2���A�:��M��,�,��&��0����� �&�&�w�!��4���I�I�K��"�[�[��^�1�1�3�3���s��j�!�'�'��3�A���()����1�a�(8�%�H�I�� �	��2�A��$�8�)�B�C�.�8��2�A��#�7��2�3��7�%�a��O�	��$�Y�/�	��L�L�(�.�.�*�I�6�7�����A��j����%�%�'���k�!����W�v�.�/��M��<�<�����#�#�C�/�
�
�
� � ��,��1�1�1��#�#�C�(��
rc�l�URn[RX!5nU(a�UR5nX$US-nUS:XaUS-$US:Xa@UR	SU5(aUS-$UR	SU5(agXA:�aU$US-$US:XagUS;agXA:�aU$US-$[S	5e)
Nr#r�/rrr<r=rz6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzwe should not get here!)r�locatestarttagend_tolerantrIrRrG�AssertionError)rrVrrrX�nexts      rrs�$HTMLParser.check_for_whole_start_tagYs����,�,��&�,�,�W�8�������A��Q�q�S�>�D��s�{��1�u���s�{��%�%�d�A�.�.��q�5�L��%�%�c�1�-�-���5��H��q�5�L��r�z���5�6���u����1�u���6�7�7rc��URn[RX!S-5nU(dgUR5n[RX!5nU(d�URbURX!U5 U$[RX!S-5nU(d!X!US-S:XaUS-$URU5$URS5R5nURSUR55nURU5 US-$URS5R5nURb$XpR:waURX!U5 U$URU5 UR5 U$)Nr#r=r<r_z</>r)r�	endendtagrCrR�
endtagfindrIrrErtrcrPr,r@�
handle_endtagr5)rrVrrIrd�	namematch�tagnamer0s        rrK�HTMLParser.parse_endtag{sM���,�,��� � ��A�#�.�����	�	���� � ��,������*�� � ��5�!1�2���(�.�.�w�!��<�I���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�~�#�#�%���?�?�&����&�� � ��5�!1�2������4� ������rc�H�URX5 URU5 gr4)rzr��rr~r}s   rry�HTMLParser.handle_startendtag�s�����S�(����3�rc��gr4�r�s   rrz�HTMLParser.handle_starttag����rc��gr4r�)rr~s  rr��HTMLParser.handle_endtag�r�rc��gr4r��rr[s  rrQ�HTMLParser.handle_charref�r�rc��gr4r�r�s  rrT�HTMLParser.handle_entityref�r�rc��gr4r�rs  rrE�HTMLParser.handle_data�r�rc��gr4r�rs  rrg�HTMLParser.handle_comment�r�rc��gr4r�)r�decls  rrb�HTMLParser.handle_decl�r�rc��gr4r�rs  rrm�HTMLParser.handle_pi�r�rc��gr4r�rs  r�unknown_decl�HTMLParser.unknown_decl�r�r)�__starttag_textrr
rrr)r#)!�__name__�
__module__�__qualname__�__firstlineno__�__doc__r{r
rr r%r(r)r1r5rrNrcrMrJrsrKryrzr�rQrTrErgrbrmr��__static_attributes__�
__classcell__)rs@rrr>s�����*1��+/�������O�$�N��u#�t/�*	�	�(�X8�D%�P �

�
�
�
�
�
�
�
�
�
r)r�r-�_markupbase�htmlr�__all__r.rrUrSrOrHrl�commentclosertru�VERBOSEr�r�r��
ParserBaserr�rr�<module>r�s���"�
����.���Z�Z��'��
�Z�Z��
%�
��J�J�>�?�	�
�*�*�@�
A���z�z�+�&��
�*�*�S�/���z�z�)�$���:�:�L�M���J�J�=�>�� �Z�Z�)��Z�Z���
�J�J�s�O�	��Z�Z�>�
?�
�J
��'�'�J
r

?>