Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/lxml/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/lxml/__pycache__/cssselect.cpython-311.pyc

�

�܋f&
��:�dZddlmZddlmZ	ddlZn#e$red���wxYwejZej	Z	ej
Z
gd�ZGd�d	ej��Z
Gd
�de
ej��Zd�Zejd
��Zde_eed<Gd�dej��ZdS)z�CSS Selectors based on XPath.

This module supports selecting XML/HTML tags based on CSS selectors.
See the `CSSSelector` class for details.

This is a thin wrapper around cssselect 0.7 or later.
�)�absolute_import�)�etreeNzRcssselect does not seem to be installed. See http://packages.python.org/cssselect/)�SelectorSyntaxError�ExpressionError�
SelectorError�CSSSelectorc��eZdZdZd�ZdS)�LxmlTranslatorzR
    A custom CSS selector to XPath translator with lxml-specific extensions.
    c��|���dgdgfvrtd|jz���|jdj}|�d|�|�����z��S)N�STRING�IDENTz9Expected a single string or ident for :contains(), got %rrz7contains(__lxml_internal_css:lower-case(string(.)), %s))�argument_typesr�	arguments�value�
add_condition�
xpath_literal�lower)�self�xpath�functionrs    �a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/lxml/cssselect.py�xpath_contains_functionz&LxmlTranslator.xpath_contains_function!s����"�"�$�$�h�Z�'��,C�C�C�!�K��$�%�&�&�
&��"�1�%�+���"�"�E�� � ������/�/�
0�1�1�	1�N)�__name__�
__module__�__qualname__�__doc__r�rrrrs-��������
1�
1�
1�
1�
1rrc��eZdZdZdS)�LxmlHTMLTranslatorz)
    lxml extensions + HTML support.
    N)rrrrrrrr!r!.s���������rr!c�*�|���S)N)r)�context�ss  r�_make_lower_caser%4s���7�7�9�9�rzhttp://codespeak.net/lxml/css/�__lxml_internal_cssz
lower-casec� �eZdZdZdd�Zd�ZdS)r	a�A CSS selector.

    Usage::

        >>> from lxml import etree, cssselect
        >>> select = cssselect.CSSSelector("a tag > child")

        >>> root = etree.XML("<a><b><c/><tag><child>TEXT</child></tag></b></a>")
        >>> [ el.tag for el in select(root) ]
        ['child']

    To use CSS namespaces, you need to pass a prefix-to-namespace
    mapping as ``namespaces`` keyword argument::

        >>> rdfns = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
        >>> select_ns = cssselect.CSSSelector('root > rdf|Description',
        ...                                   namespaces={'rdf': rdfns})

        >>> rdf = etree.XML((
        ...     '<root xmlns:rdf="%s">'
        ...       '<rdf:Description>blah</rdf:Description>'
        ...     '</root>') % rdfns)
        >>> [(el.tag, el.text) for el in select_ns(rdf)]
        [('{http://www.w3.org/1999/02/22-rdf-syntax-ns#}Description', 'blah')]

    N�xmlc��|dkrt��}n+|dkrt��}n|dkrtd���}|�|��}tj�|||���||_dS)Nr(�html�xhtmlT)r+)�
namespaces)rr!�css_to_xpathr�XPath�__init__�css)rr0r,�
translator�paths     rr/zCSSSelector.__init__Ws�������'�)�)�J�J�
�6�
!�
!�+�-�-�J�J�
�7�
"�
"�+�$�7�7�7�J��&�&�s�+�+��
����T�4�J��?�?�?�����rc
��d|jj�dttt	|������dd��d|j�d�S)N�<� �z for �>)�	__class__r�hex�abs�idr0)rs r�__repr__zCSSSelector.__repr__bsK����N�#�#�#���B�t�H�H�
�
���q�r�r�"�"�"��H�H�H��	r)Nr()rrrrr/r<rrrr	r	<sA��������4	�	�	�	�����rr	)r�
__future__r�r�	cssselect�external_cssselect�ImportErrorrrr�__all__�GenericTranslatorr�HTMLTranslatorr!r%�FunctionNamespace�ns�prefixr.r	rrr�<module>rHsr����'�&�&�&�&�&�������5�*�*�*�*�*���5�5�5�
�+�	4�5�5�5�5����)�<��$�4��"�0�
�����1�1�1�1�1�'�9�1�1�1�"������);�)J��������U��=�>�>��!��	�#��<��*�*�*�*�*�%�+�*�*�*�*�*s��&

Hacked By AnonymousFox1.0, Coded By AnonymousFox