JFIF$        dd7 

Viewing File: /usr/lib64/python3.9/html/__pycache__/parser.cpython-39.pyc

a

�i�R�@s�dZddlZddlZddlmZdgZe�d�Ze�d�Ze�d�Z	e�d�Z
e�d	�Ze�d
�Ze�d�Z
e�d�Ze�d
�Ze�d�Ze�dej�Ze�dej�Ze�dej�Ze�d�Ze�d�ZGdd�dej�ZdS)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
</[a-zA-Z]�>z--!?>z-?>z0([a-zA-Z][^\t\n\r\f />]*)(?:[\t\n\r\f ]|/(?!>))*a{
  (
    (?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]*  # attribute name
   )
  ([\t\n\r\f ]*=[\t\n\r\f ]*        # value indicator
    ('[^']*'                        # LITA-enclosed value
    |"[^"]*"                        # LIT-enclosed value
    |(?!['"])[^>\t\n\r\f ]*         # bare value
    )
   )?
  (?:[\t\n\r\f ]|/(?!>))*           # possibly followed by a space
a
  [a-zA-Z][^\t\n\r\f />]*           # tag name
  [\t\n\r\f /]*                     # optional whitespace before attribute name
  (?:(?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]*  # attribute name
    (?:[\t\n\r\f ]*=[\t\n\r\f ]*    # value indicator
      (?:'[^']*'                    # LITA-enclosed value
        |"[^"]*"                    # LIT-enclosed value
        |(?!['"])[^>\t\n\r\f ]*     # bare value
       )
     )?
    [\t\n\r\f /]*                   # possibly followed by a space
   )*
   >?
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@seZdZdZdZdZddd�dd�Zd	d
�Zdd�Zd
d�Z	dZ
dd�Zdd�dd�Zdd�Z
d>dd�Zdd�Zdd�Zd?dd�Zd@d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z dS)AraEFind 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.
    )Zscript�styleZxmpZiframeZnoembedZnoframes)Ztextarea�titleTF)�convert_charrefs�	scriptingcCs||_||_|��dS)azInitialize and reset this instance.

        If convert_charrefs is true (the default), all character references
        are automatically converted to the corresponding Unicode characters.

        If *scripting* is false (the default), the content of the
        ``noscript`` element is parsed normally; if it's true,
        it's returned as is without being parsed.
        N)rr�reset)�selfrr�r�#/usr/lib64/python3.9/html/parser.py�__init__vs
zHTMLParser.__init__cCs4d|_d|_t|_d|_d|_d|_tj�	|�dS)z1Reset this instance.  Loses all unprocessed data.�z???NT)
�rawdata�lasttag�interesting_normal�interesting�
cdata_elem�_support_cdata�
_escapable�_markupbase�
ParserBaser	�r
rrrr	�szHTMLParser.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.�N)rrrrr�close�szHTMLParser.closeNcCs|jS)z)Return full source of start tag: '<...>'.)�_HTMLParser__starttag_textrrrr�get_starttag_text�szHTMLParser.get_starttag_text��	escapablecCsp|��|_||_|jdkr(t�d�|_nD|rP|jsPt�d|jtjtjB�|_nt�d|jtjtjB�|_dS)N�	plaintextz\Zz&|</%s(?=[\t\n\r\f />])z</%s(?=[\t\n\r\f />]))	�lowerrr�re�compilerr�
IGNORECASE�ASCII)r
�elemr"rrr�set_cdata_mode�s



�
�zHTMLParser.set_cdata_modecCst|_d|_d|_dS)NT)rrrrrrrr�clear_cdata_mode�szHTMLParser.clear_cdata_modecCs
||_dS)aEnable or disable support of the CDATA sections.
        If enabled, "<[CDATA[" starts a CDATA section which ends with "]]>".
        If disabled, "<[CDATA[" starts a bogus comments which ends with ">".

        This method is not called by default. Its purpose is to be called
        in custom handle_starttag() and handle_endtag() methods, with
        value that depends on the adjusted current node.
        See https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state
        for details.
        N)r)r
�flagrrr�_set_support_cdata�szHTMLParser._set_support_cdatacCsB|j}d}t|�}||k�r�|jrv|jsv|�d|�}|dkr�|�dt||d��}|dkrpt�d��	||�sp�q�|}n*|j
�	||�}|r�|��}n|jr��q�|}||kr�|jr�|jr�|�
t|||���n|�
|||��|�||�}||kr��q�|j}|d|��r<t�||��r"|�|�}	n�|d|��r:|�|�}	nt|d|��rR|�|�}	n\|d|��rj|�|�}	nD|d	|��r�|�|�}	n,|d
|k�s�|�r�|�
d�|d
}	n�q�|	dk�r.|�sq�t�||��rԐnV|d|��r$|d|k�r�|�
d�n&t�||��r
n|�||dd���n|d|��r||}dD]*}
|�|
|d
��r8|t|
�8}�qd�q8|�||d
|��n�|d|��r�|j�r�|�||dd��n�|||d���dk�r�|�||dd��nP|d	|��r�|�||dd��n,|d|��r"|�||dd��nt d��|}	|�||	�}q|d|��r�t!�||�}|�r�|�"�dd�}|�#|�|�$�}	|d|	d
��s�|	d
}	|�||	�}qn<d||d�v�r�|�
|||d��|�||d�}�q�q|d|��r�t%�||�}|�rB|�"d
�}|�&|�|�$�}	|d|	d
��s4|	d
}	|�||	�}qt'�||�}|�r�|�r�|�"�||d�k�r�|�$�}	|	|k�r�|}	|�||d
�}�q�n.|d
|k�r�|�
d�|�||d
�}n�q�qdsJd��q|�r0||k�r0|j�r|j�r|�
t|||���n|�
|||��|�||�}||d�|_dS)Nr�<�&�"z[\t\n\r\f ;]�</�<!--�<?�<!r�)z--!z--�-��	<![CDATA[��	�	<!doctypezwe should not get here!z&#����;zinteresting.search() lied)(r�lenrr�find�rfind�maxr%r&�searchr�startr�handle_datarZ	updatepos�
startswith�starttagopen�match�parse_starttag�parse_endtag�
parse_comment�parse_pi�parse_html_declaration�
endtagopen�handle_comment�endswithr�unknown_declr$�handle_decl�	handle_pi�AssertionError�charref�group�handle_charref�end�	entityref�handle_entityref�
incomplete)r
rWr�i�n�jZampposrGrE�k�suffix�namerrrr�s�
�









zHTMLParser.goaheadcCst|j}|||d�dks"Jd��|||d�dkr@|�|�S|||d�dkr�|jr�|�d|d�}|d	krvd
S|�||d|��|dS|||d���dkr�|�d
|d�}|d
kr�d
S|�||d|��|dS|||d�dk�rf|�d
|d�}|d	k�rd
S||ddk�rH|�||d|d��n|�||d|��|dS|�|�SdS)Nr5r4z+unexpected call to parse_html_declaration()r7r2r:r8z]]>rr<r9r;rrz<![�])	rrJrr?rPr$rQrN�parse_bogus_comment)r
r[rr]ZgtposrrrrLNs2

z!HTMLParser.parse_html_declarationcCsp|j}|�d|�sJd��t�||d�}|sFt�||d�}|sFdS|rh|��}|�||d|��|��S)Nr2�"unexpected call to parse_comment()r7r<)	rrE�commentcloserB�commentabruptcloserGrCrNrW)r
r[�reportrrGr]rrrrJpszHTMLParser.parse_commentrcCs`|j}|||d�dvs"Jd��|�d|d�}|dkr>dS|rX|�||d|��|dS)Nr5)r4r1rcrr<r)rr?rN)r
r[rfr�posrrrrbszHTMLParser.parse_bogus_commentcCsd|j}|||d�dks"Jd��t�||d�}|s:dS|��}|�||d|��|��}|S)Nr5r3zunexpected call to parse_pi()r<)r�picloserBrCrRrW�r
r[rrGr]rrrrK�szHTMLParser.parse_picCs(d|_|�|�}|dkr|S|j}|||�|_g}t�||d�}|sPJd��|��}|�d���|_}||k�r.t	�||�}|s��q.|�ddd�\}	}
}|
s�d}n\|dd�dkr�|dd�ks�n|dd�dkr�|dd�k�rnn|dd�}|�rt
|�}|�|	��|f�|��}ql|||���}|d	v�r�|�
�\}
}d
|jv�r�|
|j�d
�}
t|j�|j�d
�}n|t|j�}|�|||��|S|�d��r�|�||�n^|�||�||jv�s�|j�r�|dk�s�|d
k�r
|j|dd�n||jv�r$|j|dd�|S)Nrrz#unexpected call to parse_starttag()r5r9�'r<�")r�/>�
rlZnoscriptr#Fr!T)r�check_for_whole_start_tagr�tagfind_tolerantrGrWrUr$r�attrfind_tolerantr�append�stripZgetpos�countr>r@rDrO�handle_startendtag�handle_starttag�CDATA_CONTENT_ELEMENTSrr*�RCDATA_CONTENT_ELEMENTS)r
r[�endposr�attrsrGr^�tag�m�attrname�restZ	attrvaluerW�lineno�offsetrrrrH�sj

&�
�


����zHTMLParser.parse_starttagcCs>|j}t�||d�}|sJ�|��}||ddkr:dS|S)Nrrr<)r�locatetagendrGrWrirrrrn�sz$HTMLParser.check_for_whole_start_tagcCs�|j}|||d�dks"Jd��|�d|d�dkr:dSt�||�sp||d|d�dkrf|dS|�|�St�||d�}|s�J�|��}||ddkr�dSt�||d�}|s�J�|�d��	�}|�
|�|��|S)	Nr5r1zunexpected call to parse_endtagrrr<r9r)rr?rMrGrbr�rWrorUr$�
handle_endtagr+)r
r[rrGr]rzrrrrI�s&

zHTMLParser.parse_endtagcCs|�||�|�|�dS�N)rur��r
rzryrrrrt�szHTMLParser.handle_startendtagcCsdSr�rr�rrrru�szHTMLParser.handle_starttagcCsdSr�r)r
rzrrrr�szHTMLParser.handle_endtagcCsdSr�r�r
r`rrrrVszHTMLParser.handle_charrefcCsdSr�rr�rrrrY	szHTMLParser.handle_entityrefcCsdSr�rrrrrrD
szHTMLParser.handle_datacCsdSr�rrrrrrNszHTMLParser.handle_commentcCsdSr�r)r
ZdeclrrrrQszHTMLParser.handle_declcCsdSr�rrrrrrRszHTMLParser.handle_picCsdSr�rrrrrrPszHTMLParser.unknown_decl)T)T)r)!�__name__�
__module__�__qualname__�__doc__rvrwr
r	rrrr r*r+r-rrLrJrbrKrHrnrIrtrur�rVrYrDrNrQrRrPrrrrrZs>
	

"

9
)r�r%rZhtmlr�__all__r&rrZrXrTrFrMrhrdrero�VERBOSErpr�Zlocatestarttagend_tolerantZ	endendtagZ
endtagfindrrrrrr�<module>s4











�
��


Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(zȰ+i*NAr6KnSl)!JJӁ* %݉?|D}d5:eP0R;{$X'xF@.ÊB {,WJuQɲRI;9QE琯62fT.DUJ;*cP A\ILNj!J۱+O\͔]ޒS߼Jȧc%ANolՎprULZԛerE2=XDXgVQeӓk yP7U*omQIs,K`)6\G3t?pgjrmۛجwluGtfh9uyP0D;Uڽ"OXlif$)&|ML0Zrm1[HXPlPR0'G=i2N+0e2]]9VTPO׮7h(F*癈'=QVZDF,d߬~TX G[`le69CR(!S2!P <0x<!1AQ "Raq02Br#SCTb ?Ζ"]mH5WR7k.ۛ!}Q~+yԏz|@T20S~Kek *zFf^2X*(@8r?CIuI|֓>^ExLgNUY+{.RѪ τV׸YTD I62'8Y27'\TP.6d&˦@Vqi|8-OΕ]ʔ U=TL8=;6c| !qfF3aů&~$l}'NWUs$Uk^SV:U# 6w++s&r+nڐ{@29 gL u"TÙM=6(^"7r}=6YݾlCuhquympǦ GjhsǜNlɻ}o7#S6aw4!OSrD57%|?x>L |/nD6?/8w#[)L7+6〼T ATg!%5MmZ/c-{1_Je"|^$'O&ޱմTrb$w)R$& N1EtdU3Uȉ1pM"N*(DNyd96.(jQ)X 5cQɎMyW?Q*!R>6=7)Xj5`J]e8%t!+'!1Q5 !1 AQaqё#2"0BRb?Gt^## .llQT $v,,m㵜5ubV =sY+@d{N! dnO<.-B;_wJt6;QJd.Qc%p{ 1,sNDdFHI0ГoXшe黅XۢF:)[FGXƹ/w_cMeD,ʡcc.WDtA$j@:) -# u c1<@ۗ9F)KJ-hpP]_x[qBlbpʖw q"LFGdƶ*s+ډ_Zc"?%t[IP 6J]#=ɺVvvCGsGh1 >)6|ey?Lӣm,4GWUi`]uJVoVDG< SB6ϏQ@ TiUlyOU0kfV~~}SZ@*WUUi##; s/[=!7}"WN]'(L! ~y5g9T̅JkbM' +s:S +B)v@Mj e Cf jE 0Y\QnzG1д~Wo{T9?`Rmyhsy3!HAD]mc1~2LSu7xT;j$`}4->L#vzŏILS ֭T{rjGKC;bpU=-`BsK.SFw4Mq]ZdHS0)tLg