HEX
Server: Apache
System: Linux vps.rockyroadprinting.net 4.18.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User: rockyroadprintin (1011)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/python2.7/site-packages/lxml/html/soupparser.pyo
�
�'�Yc@s�dZdddgZddlZddlmZmZyDddlmZmZm	Z	m
Z
mZmZm
Z
ee
fZWnEek
r�ddlmZmZm	Z	m
Z
mZmZeZnXddd	�Zddd
�Zdd�Zd�Zejd
ej�jZddd��YZd�Zd�ZyddlmZWn!ek
rjddlmZnXejd�jZ ye!Wne"k
r�e#Z!nXd�Z$dS(s5External interface to the BeautifulSoup HTML parser.
t
fromstringtparsetconvert_treei����N(tetreethtml(t
BeautifulSouptTagtCommenttProcessingInstructiontNavigableStringtDeclarationtDoctype(RRRRR	R
cKst||||�S(s�Parse a string of HTML data into an Element tree using the
    BeautifulSoup parser.

    Returns the root ``<html>`` Element of the tree.

    You can pass a different BeautifulSoup parser through the
    `beautifulsoup` keyword, and a diffent Element factory function
    through the `makeelement` keyword.  By default, the standard
    ``BeautifulSoup`` class and the default factory of `lxml.html` are
    used.
    (t_parse(tdatat
beautifulsouptmakeelementtbsargs((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyRscKs@t|d�st|�}nt||||�}tj|�S(sYParse a file into an ElemenTree using the BeautifulSoup parser.

    You can pass a different BeautifulSoup parser through the
    `beautifulsoup` keyword, and a diffent Element factory function
    through the `makeelement` keyword.  By default, the standard
    ``BeautifulSoup`` class and the default factory of `lxml.html` are
    used.
    tread(thasattrtopenRRtElementTree(tfileRRRtroot((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyR$s	cCs=t||�}|j�}x|D]}|j|�q"W|S(sConvert a BeautifulSoup tree to a list of Element trees.

    Returns a list instead of a single root Element to support
    HTML-like soup with more than one root element.

    You can pass a different Element factory through the `makeelement`
    keyword.
    (t
_convert_treetgetchildrentremove(tbeautiful_soup_treeRRtchildrentchild((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyR3s
	
cKs�|dkrt}nt|d�r@d|kr@d|d<q@nt|d�rkd|krkd|d<qkn|||�}t||�}t|�dkr�|djdkr�|dSd|_|S(	Nt
HTML_ENTITIEStconvertEntitiesRtDEFAULT_BUILDER_FEATUREStfeaturesshtml.parserii(tNoneRRRtlenttag(tsourceRRRttreeR((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyREs	%	s`(?:\s|[<!])*DOCTYPE\s*HTML(?:\s+PUBLIC)?(?:\s+(\'[^\']*\'|"[^"]*"))?(?:\s+(\'[^\']*\'|"[^"]*"))?t
_PseudoTagcBseZd�Zd�ZRS(cCsd|_g|_||_dS(NR(tnametattrstcontents(tselfR)((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyt__init__`s		cCs
|jj�S(N(R)t__iter__(R*((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyR,es(t__name__t
__module__R+R,(((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyR&^s	cCs�|dkrtjj}nd}}d}}x�t|�D]�\}}t|t�r�|dkrl|}n|}|dkr�|jr�|jj�dkr�|}q�q<|dkr<t|t	�r<|}q<q<W|dkr�g}}	|j
}
n2|j
| }|j
||d!}
|j
|d}	|dk	rb|
j|�}|
| |j
|
|d|_
nt|
�}t
|�}||�}|}
xBt|�D]4}||�}|dk	r�|
j|�|}
q�q�W|}
x<|	D]4}||�}|dk	r�|
j|�|}
q�q�W|dk	r�y|j�}Wntk
rN|j}nXt|�}|sdq�|j�\}}|j�j}|o�|dd!|_|o�|dd!|_n|S(NRii����(R!Rthtml_parserRt	enumeratet
isinstanceRR'tlowert_DECLARATION_OR_DOCTYPER)tindexR&t_init_node_converterstreversedtaddprevioustaddnexttoutput_readytAttributeErrortstringt_parse_doctype_declarationtgroupstgetroottreetdocinfot	public_idt
system_url(RRtfirst_element_idxtlast_element_idxt	html_roottdeclarationtitetpre_roott	post_roottrootstconvert_nodetres_roottprevt	convertedtdoctype_stringtmatchtexternal_idtsys_uriR?((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyRisd

	*


#






cs�i�g���fd�}��fd��d��fd��d��d��|tt�����fd��}|t�d��}|t�d��}|t��fd	��}�S(
Ncs���fd�}|S(Ncs,x%�D]}|�|<�j|�qW|S(N(tappend(thandlertt(t
converterstordered_node_typesttypes(s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pytadd�s

((RXRY(RVRW(RXs:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyt	converter�scs,x%�D]}t||�r�|SqWdS(N(R1R!(tnodeRU(RVRW(s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pytfind_best_converter�s
cs_y�t|�}Wn+tk
rA�|�}�t|�<nX|dkrRdS|||�S(N(ttypetKeyErrorR!(tbs_nodetparentRT(RVR\(s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyRK�s
cSs�t|t�rfi}xd|j�D]=\}}t|t�rOdj|�}nt|�||<q"Wntd�|D��}|S(Nt css'|]\}}|t|�fVqdS(N(tunescape(t.0tktv((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pys	<genexpr>�s(R1tdicttitemstlisttjoinRb(tbs_attrstattribsRdRe((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyt	map_attrs�scSsMt|�dkr+|jpd||_n|djp;d||d_dS(Niti����(R"ttextttail(R`Rn((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pytappend_text�scs�|j}|dk	rK|r'�|�nd}tj||jd|�}n-|r]�|�ni}�|jd|�}xb|D]Z}y�t|�}Wntk
r�n X|dk	r|||�qq�||�qW|S(Ntattrib(R(R!Rt
SubElementR'R]R^(R_R`R(RktresRRT(RKRVRRl(s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pytconvert_tag�s 	

cSs/tj|�}|dk	r+|j|�n|S(N(RtHtmlCommentR!RS(R_R`Rs((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pytconvert_commentscSsW|jd�r|d }ntj|jdd��}|dk	rS|j|�n|S(Nt?i����Rai(tendswithRRtsplitR!RS(R_R`Rs((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyt
convert_pis
cs&|dk	r"�|t|��ndS(N(R!Rb(R_R`(Rp(s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pytconvert_texts(R!RR&RRR	(RRZRtRvRzR{((RpRKRVR\RRlRWs:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyR5�s
		'(tname2codepoints&(\w+);cCs |s
dSd�}t||�S(NRmcSs=ytt|jd��SWntk
r8|jd�SXdS(Nii(tunichrR|tgroupR^(tm((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pytunescape_entity5s
(thandle_entities(R;R�((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyRb1s	((%t__doc__t__all__tretlxmlRRtbs4RRRRR	R
RR3tImportErrorR!RRRRtcompilet
IGNORECASERPR<R&RR5t
html.entitiesR|thtmlentitydefstsubR�R}t	NameErrortchrRb(((s:/usr/lib64/python2.7/site-packages/lxml/html/soupparser.pyt<module>s:4
.
		U	c