Sindbad~EG File Manager

Current Path : /proc/2233733/root/usr/local/lib/python3.12/site-packages/bs4/__pycache__/
Upload File :
Current File : //proc/2233733/root/usr/local/lib/python3.12/site-packages/bs4/__pycache__/css.cpython-312.pyc

�

(ٜg]'��|�dZddlZ	ddlZGd�de�Zy#e$rZdZej
d�YdZ[�*dZ[wwxYw)zFIntegration code for CSS selectors using Soup Sieve (pypi: soupsieve).�NzEThe soupsieve package is not installed. CSS selectors cannot be used.c�d�eZdZdZefd�Zd�Zd�Zd�Zdd�Z	dd�Z
dd	�Zdd
�Zdd�Z
dd�Zdd
�Zy)�CSSa�A proxy object against the soupsieve library, to simplify its
    CSS selector API.

    Acquire this object through the .css attribute on the
    BeautifulSoup object, or on the Tag you want to use as the
    starting point for a CSS selector.

    The main advantage of doing this is that the tag to be selected
    against doesn't need to be explicitly specified in the function
    calls, since it's already scoped to a tag.
    c�:�|�td��||_||_y)a�Constructor.

        You don't need to instantiate this class yourself; instead,
        access the .css attribute on the BeautifulSoup object, or on
        the Tag you want to use as the starting point for your CSS
        selector.

        :param tag: All CSS selectors will use this as their starting
        point.

        :param api: A plug-in replacement for the soupsieve module,
        designed mainly for use in tests.
        NzLCannot execute CSS selectors because the soupsieve package is not installed.)�NotImplementedError�api�tag)�selfrrs   �2/usr/local/lib/python3.12/site-packages/bs4/css.py�__init__zCSS.__init__s)���;�%�^��
�������c�Z�t�td��|jj|�S)z�Escape a CSS identifier.

        This is a simple wrapper around soupselect.escape(). See the
        documentation for that function for more information.
        zMCannot escape CSS identifiers because the soupsieve package is not installed.)�	soupsieverr�escape)r	�idents  r
rz
CSS.escape/s/����%�_��
��x�x���u�%�%rc�v�t||jj�s|�|jj}|S)z%Normalize a dictionary of namespaces.)�
isinstancer�	SoupSiever�_namespaces)r	�ns�selects   r
�_nszCSS._ns;s0���&�$�(�(�"4�"4�5�"�*����%�%�B��	rc� �ddlm}|d|�S)aNormalize a list of results to a Resultset.

        A ResultSet is more consistent with the rest of Beautiful
        Soup's API, and ResultSet.__getattr__ has a helpful error
        message if you try to treat a list of results as a single
        result (a common mistake).
        r)�	ResultSetN)�bs4.elementr)r	�resultsrs   r
�_rszCSS._rsDs��	*���w�'�'rNc�`�|jj||j||�|fi|��S)a~Pre-compile a selector and return the compiled object.

        :param selector: A CSS selector.

        :param namespaces: A dictionary mapping namespace prefixes
           used in the CSS selector to namespace URIs. By default,
           Beautiful Soup will use the prefixes it encountered while
           parsing the document.

        :param flags: Flags to be passed into Soup Sieve's
            soupsieve.compile() method.

        :param kwargs: Keyword arguments to be passed into SoupSieve's
           soupsieve.compile() method.

        :return: A precompiled selector object.
        :rtype: soupsieve.SoupSieve
        )r�compiler�r	r�
namespaces�flags�kwargss     r
rzCSS.compilePs7��& �t�x�x����D�H�H�Z��0�%�
�;A�
�	
rc�v�|jj||j|j||�|fi|��S)aKPerform a CSS selection operation on the current Tag and return the
        first result.

        This uses the Soup Sieve library. For more information, see
        that library's documentation for the soupsieve.select_one()
        method.

        :param selector: A CSS selector.

        :param namespaces: A dictionary mapping namespace prefixes
           used in the CSS selector to namespace URIs. By default,
           Beautiful Soup will use the prefixes it encountered while
           parsing the document.

        :param flags: Flags to be passed into Soup Sieve's
            soupsieve.select_one() method.

        :param kwargs: Keyword arguments to be passed into SoupSieve's
           soupsieve.select_one() method.

        :return: A Tag, or None if the selector has no match.
        :rtype: bs4.element.Tag

        )r�
select_onerrrs     r
r$zCSS.select_onegs=��2#�t�x�x�"�"��D�H�H�d�h�h�z�6�:�E�
�EK�
�	
rc
��|�d}|j|jj||j|j	||�||fi|���S)awPerform a CSS selection operation on the current Tag.

        This uses the Soup Sieve library. For more information, see
        that library's documentation for the soupsieve.select()
        method.

        :param selector: A string containing a CSS selector.

        :param namespaces: A dictionary mapping namespace prefixes
            used in the CSS selector to namespace URIs. By default,
            Beautiful Soup will pass in the prefixes it encountered while
            parsing the document.

        :param limit: After finding this number of results, stop looking.

        :param flags: Flags to be passed into Soup Sieve's
            soupsieve.select() method.

        :param kwargs: Keyword arguments to be passed into SoupSieve's
            soupsieve.select() method.

        :return: A ResultSet of Tag objects.
        :rtype: bs4.element.ResultSet

        r)rrrrr�r	rr �limitr!r"s      r
rz
CSS.select�sS��4�=��E��x�x��D�H�H�O�O�����$�(�(�:�v�">��u�
��
�
�	
rc�x�|jj||j|j||�||fi|��S)a�Perform a CSS selection operation on the current Tag.

        This uses the Soup Sieve library. For more information, see
        that library's documentation for the soupsieve.iselect()
        method. It is the same as select(), but it returns a generator
        instead of a list.

        :param selector: A string containing a CSS selector.

        :param namespaces: A dictionary mapping namespace prefixes
            used in the CSS selector to namespace URIs. By default,
            Beautiful Soup will pass in the prefixes it encountered while
            parsing the document.

        :param limit: After finding this number of results, stop looking.

        :param flags: Flags to be passed into Soup Sieve's
            soupsieve.iselect() method.

        :param kwargs: Keyword arguments to be passed into SoupSieve's
            soupsieve.iselect() method.

        :return: A generator
        :rtype: types.GeneratorType
        )r�iselectrrr&s      r
r)zCSS.iselect�s?��4 �t�x�x����D�H�H�d�h�h�z�6�:�E�5�
�LR�
�	
rc�v�|jj||j|j||�|fi|��S)a6Find the Tag closest to this one that matches the given selector.

        This uses the Soup Sieve library. For more information, see
        that library's documentation for the soupsieve.closest()
        method.

        :param selector: A string containing a CSS selector.

        :param namespaces: A dictionary mapping namespace prefixes
            used in the CSS selector to namespace URIs. By default,
            Beautiful Soup will pass in the prefixes it encountered while
            parsing the document.

        :param flags: Flags to be passed into Soup Sieve's
            soupsieve.closest() method.

        :param kwargs: Keyword arguments to be passed into SoupSieve's
            soupsieve.closest() method.

        :return: A Tag, or None if there is no match.
        :rtype: bs4.Tag

        )r�closestrrrs     r
r+zCSS.closest�s=��0 �t�x�x����D�H�H�d�h�h�z�6�:�E�
�EK�
�	
rc�v�|jj||j|j||�|fi|��S)aCheck whether this Tag matches the given CSS selector.

        This uses the Soup Sieve library. For more information, see
        that library's documentation for the soupsieve.match()
        method.

        :param: a CSS selector.

        :param namespaces: A dictionary mapping namespace prefixes
            used in the CSS selector to namespace URIs. By default,
            Beautiful Soup will pass in the prefixes it encountered while
            parsing the document.

        :param flags: Flags to be passed into Soup Sieve's
            soupsieve.match() method.

        :param kwargs: Keyword arguments to be passed into SoupSieve's
            soupsieve.match() method.

        :return: True if this Tag matches the selector; False otherwise.
        :rtype: bool
        )r�matchrrrs     r
r-z	CSS.match�s;��.�t�x�x�~�~��D�H�H�d�h�h�z�6�:�E�
�EK�
�	
rc
��|j|jj||j|j	||�|fi|���S)aWFilter this Tag's direct children based on the given CSS selector.

        This uses the Soup Sieve library. It works the same way as
        passing this Tag into that library's soupsieve.filter()
        method. More information, for more information see the
        documentation for soupsieve.filter().

        :param namespaces: A dictionary mapping namespace prefixes
            used in the CSS selector to namespace URIs. By default,
            Beautiful Soup will pass in the prefixes it encountered while
            parsing the document.

        :param flags: Flags to be passed into Soup Sieve's
            soupsieve.filter() method.

        :param kwargs: Keyword arguments to be passed into SoupSieve's
            soupsieve.filter() method.

        :return: A ResultSet of Tag objects.
        :rtype: bs4.element.ResultSet

        )rr�filterrrrs     r
r/z
CSS.filter�sG��.�x�x��D�H�H�O�O�����$�(�(�:�v�">��
�IO�
�
�	
r)Nr)Nrr)�__name__�
__module__�__qualname__�__doc__rrrrrrr$rr)r+r-r/�rr
rr
sD��
�!*��*
&��
(�
�.
�:"
�H
�<
�8
�6
rr)r3�warningsr�ImportError�e�warn�objectrr4rr
�<module>r:sN��L����K
�&�K
�����I��H�M�M�O�����s��;�6�;

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists