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: //lib/python2.7/site-packages/bs4/builder/__init__.pyc
�
�Jp[c@s�ddlmZddlZddlZddlmZmZmZmZddddgZ	dZ
d	Zd
ZdZ
dZd
Zdefd��YZe�Zdefd��YZdefd��YZdefd��YZd�Zdefd��YZddlmZee�yddlmZee�Wnek
rKnXyddlmZee�Wnek
r}nXdS(i����(tdefaultdictN(tCharsetMetaAttributeValuetContentMetaAttributeValuetHTMLAwareEntitySubstitutiont
whitespace_retHTMLTreeBuildertSAXTreeBuildertTreeBuildertTreeBuilderRegistrytfastt
permissivetstricttxmlthtmlthtml5cBs#eZd�Zd�Zd�ZRS(cCstt�|_g|_dS(N(Rtlisttbuilders_for_featuretbuilders(tself((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyt__init__ scCsBx(|jD]}|j|jd|�q
W|jjd|�dS(s8Register a treebuilder based on its advertised features.iN(tfeaturesRtinsertR(Rttreebuilder_classtfeature((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytregister$scGst|j�dkrdSt|�dkr6|jdSt|�}|j�d}d}x�t|�dkr�|j�}|jj|g�}t|�dkr[|dkr�|}t|�}q�|j	t|��}q[q[W|dkr�dSx|D]}||kr�|Sq�WdS(Ni(
tlenRtNoneRtreversetpopRtgettsettintersection(RRt
candidatest
candidate_setRtwe_have_the_featuret	candidate((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytlookup*s.

(t__name__t
__module__RRR$(((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyRs		cBs�eZdZdZgZgZeZeZe	�Z
d
ZiZ
d�Zd�Zd�Zd�Zd
d
d�Zd�Zd�Zd	�ZRS(s2Turn a document into a Beautiful Soup object tree.s[Unknown tree builder]cCs
d|_dS(N(Rtsoup(R((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyRfscCsdS(N((R((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytresetiscCs |jdkrtS||jkS(s�Might a tag with this name be an empty-element tag?

        The final markup may or may not actually present this tag as
        self-closing.

        For instance: an HTMLBuilder does not consider a <p> tag to be
        an empty-element tag (it's not in
        HTMLBuilder.empty_element_tags). This means an empty <p> tag
        will be presented as "<p></p>", not "<p />".

        The default implementation has no opinion about which tags are
        empty-element tags, so a tag will be presented as an
        empty-element tag if and only if it has no contents.
        "<foo></foo>" will become "<foo />", and "<foo>bar</foo>" will
        be left alone.
        N(tempty_element_tagsRtTrue(Rttag_name((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytcan_be_empty_elementlscCs
t��dS(N(tNotImplementedError(Rtmarkup((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytfeed�scCs|ddtfS(N(RtFalse(RR.tuser_specified_encodingtdocument_declared_encoding((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytprepare_markup�scCs|S(s�Wrap an HTML fragment to make it look like a document.

        Different parsers do this differently. For instance, lxml
        introduces an empty <head> tag, and html5lib
        doesn't. Abstracting this away lets us write simple tests
        which run HTML fragments through the parser and compare the
        results against other HTML fragments.

        This method should not be used outside of tests.
        ((Rtfragment((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyttest_fragment_to_document�scCstS(N(R0(Rttag((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytset_up_substitutions�scCs�|s
|S|jr�|jjdg�}|jj|j�d�}xs|j�D]b}||kst|rP||krP||}t|t�r�tj|�}n|}|||<qPqPWn|S(saReplaces class="foo bar" with class=["foo", "bar"]

        Modifies its input in place.
        t*N(	tcdata_list_attributesRtlowerRtkeyst
isinstancet
basestringRtsplit(RR+tattrst	universalttag_specifictattrtvaluetvalues((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyt$_replace_cdata_list_attribute_values�s		
N(R%R&t__doc__tNAMEtALTERNATE_NAMESRR0tis_xmlt	picklableRtpreserve_whitespace_tagsRR)R9RR(R,R/R3R5R7RE(((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyRTs$						
	cBsqeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
RS(s9A Beautiful Soup treebuilder that listens for SAX events.cCs
t��dS(N(R-(RR.((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyR/�scCsdS(N((R((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytclose�scCs9td�t|j��D��}|jj||�dS(Ncss%|]\}}|d|fVqdS(iN((t.0tkeyRC((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pys	<genexpr>�s(tdictRtitemsR'thandle_starttag(RtnameR?((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytstartElement�s"cCs|jj|�dS(N(R't
handle_endtag(RRR((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyt
endElement�scCs|j||�dS(N(RS(RtnsTupletnodeNameR?((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytstartElementNS�scCs|j|�dS(N(RU(RRVRW((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytendElementNS�scCsdS(N((Rtprefixt	nodeValue((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytstartPrefixMapping�scCsdS(N((RRZ((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytendPrefixMapping�scCs|jj|�dS(N(R'thandle_data(Rtcontent((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyt
characters�scCsdS(N((R((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyt
startDocument�scCsdS(N((R((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytendDocument�s(R%R&RFR/RLRSRURXRYR\R]R`RaRb(((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyR�s										c$BsseZdZejZeddddddddd	d
ddd
dddddddddddg�Zedddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-dd.d/d0d1d2d3d4d5d6d7d8d9d:g#�Zid;d<d=gd>6d?d@gdA6d?d@gd
6dBgdC6dBgdD6dBgdC6dEgd&6dFgdG6d?gd6dHgdI6dJgdK6dLgd36ZdM�Z	RS(Ns]This TreeBuilder knows facts about HTML.

    Such as which tags are empty-element tags.
    tareatbasetbrtcoltembedthrtimgtinputtkeygentlinktmenuitemtmetatparamtsourcettracktwbrtbasefonttbgsoundtcommandtframetimagetisindextnextidtspacertaddresstarticletasidet
blockquotetcanvastddtdivtdltdttfieldsett
figcaptiontfiguretfootertformth1th2th3th4th5th6theadertlitmaintnavtnoscripttoltoutputtptpretsectionttablettfoottultvideotclasst	accesskeytdropzoneR8treltrevtatheadersttdtthsaccept-charsettarchivetobjecttsizesticontsandboxtiframetforcCs�|jdkrtS|jd�}|jd�}|jd�}d}|dk	rk|}t|�|d<n=|dk	r�|dk	r�|j�dkr�t|�|d<n|dk	S(NRns
http-equivR_tcharsetscontent-type(RRR0RRRR:R(RR6t
http_equivR_R�t
meta_encoding((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyR7s(
R%R&RFRRKRR)tblock_elementsR9R7(((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyR�s(	0!u	










cCsvtjd}xb|jD]W}t||�}t|t�rt|||�|jj|�|jj	|�qqWdS(s9Copy TreeBuilders from the given module into this module.sbs4.builderN(
tsystmodulest__all__tgetattrt
issubclassRtsetattrtappendtbuilder_registryR(tmoduletthis_moduleRRtobj((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pytregister_treebuilders_from2s
tParserRejectedMarkupcBseZRS((R%R&(((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyR�?si(t_htmlparser(t	_html5lib(t_lxml(tcollectionsRt	itertoolsR�tbs4.elementRRRRR�tFASTt
PERMISSIVEtSTRICTtXMLtHTMLtHTML_5R�RR�RRRR�t	ExceptionR�tR�R�tImportErrorR�(((s8/usr/lib/python2.7/site-packages/bs4/builder/__init__.pyt<module>s@"	4	b.N