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/cssselect.pyc
�
U�*Wc@@sdZddlmZddlmZyddlZWnek
rUed��nXejZej	Z	ej
Z
ddd	d
gZdejfd��YZ
d
e
ejfd��YZd�Zejd�Zde_eed<d
ejfd��YZdS(s�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.
i(tabsolute_importi(tetreeNsRcssselect does not seem to be installed. See http://packages.python.org/cssselect/tSelectorSyntaxErrortExpressionErrort
SelectorErrortCSSSelectortLxmlTranslatorcB@seZdZd�ZRS(sR
    A custom CSS selector to XPath translator with lxml-specific extensions.
    cC@sd|j�dgdgfkr4td|j��n|jdj}|jd|j|j���S(NtSTRINGtIDENTs9Expected a single string or ident for :contains(), got %ris7contains(__lxml_internal_css:lower-case(string(.)), %s)(targument_typesRt	argumentstvaluet
add_conditiont
xpath_literaltlower(tselftxpathtfunctionR((s4/usr/lib64/python2.7/site-packages/lxml/cssselect.pytxpath_contains_function!s(t__name__t
__module__t__doc__R(((s4/usr/lib64/python2.7/site-packages/lxml/cssselect.pyRstLxmlHTMLTranslatorcB@seZdZRS(s)
    lxml extensions + HTML support.
    (RRR(((s4/usr/lib64/python2.7/site-packages/lxml/cssselect.pyR.scC@s
|j�S(N(R(tcontextts((s4/usr/lib64/python2.7/site-packages/lxml/cssselect.pyt_make_lower_case4sshttp://codespeak.net/lxml/css/t__lxml_internal_csss
lower-casecB@s&eZdZddd�Zd�ZRS(s�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')]

    txmlcC@s�|dkrt�}n6|dkr0t�}n|dkrNtdt�}n|j|�}tjj||d|�||_dS(NRthtmltxhtmlt
namespaces(RRtTruetcss_to_xpathRtXPatht__init__tcss(RR#Rt
translatortpath((s4/usr/lib64/python2.7/site-packages/lxml/cssselect.pyR"WscC@s0d|jjttt|���d|jfS(Ns<%s %s for %r>i(t	__class__RthextabstidR#(R((s4/usr/lib64/python2.7/site-packages/lxml/cssselect.pyt__repr__bs	N(RRRtNoneR"R*(((s4/usr/lib64/python2.7/site-packages/lxml/cssselect.pyR<s(Rt
__future__RtRt	cssselecttexternal_cssselecttImportErrorRRRt__all__tGenericTranslatorRtHTMLTranslatorRRtFunctionNamespacetnstprefixR!R(((s4/usr/lib64/python2.7/site-packages/lxml/cssselect.pyt<module>s&