AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/twisted/words/xish/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/twisted/words/xish/__pycache__/xpath.cpython-310.pyc
o

�b�$�@s�dZddlmZGdd�de�ZGdd�d�ZGdd�d�ZGd	d
�d
�ZGdd�d�Zd
d�Z	Gdd�d�Z
Gdd�d�ZGdd�d�ZGdd�d�Z
Gdd�d�ZiZdd�Zdd�Zdd�Zdd �Zd!d"�Zd#S)$z�
XPath query support.

This module provides L{XPathQuery} to match
L{domish.Element<twisted.words.xish.domish.Element>} instances against
XPath-like expressions.
�)�StringIOc@seZdZdd�ZdS)�LiteralValuecCs|S�N���self�elemrr�:/usr/lib/python3/dist-packages/twisted/words/xish/xpath.py�value�zLiteralValue.valueN)�__name__�
__module__�__qualname__r
rrrr	rsrc@�eZdZdd�Zdd�ZdS)�
IndexValuecCst|�d|_dS)N�)�int�index)rrrrr	�__init__szIndexValue.__init__cCs|j|jSr)�childrenrrrrr	r
�zIndexValue.valueN)rr
rrr
rrrr	r�rc@�$eZdZdd�Zdd�Zdd�ZdS)�AttribValuecCs ||_|jdkr|j|_dSdS)N�xmlns)�
attribname�value_nsr
)rrrrr	r s
�zAttribValue.__init__cCs|jSr)�urirrrr	r%szAttribValue.value_nscCs|j|jvr|j|jSdSr)r�
attributesrrrr	r
(szAttribValue.valueN)rr
rrrr
rrrr	rsrc@r)�CompareValuecC�,||_||_|dkr|j|_dS|j|_dS)N�=)�lhs�rhs�
_compareEqualr
�_compareNotEqual�rr"�opr#rrr	r0�
zCompareValue.__init__cCs|j�|�|j�|�kSr�r"r
r#rrrr	r$8�zCompareValue._compareEqualcCs|j�|�|j�|�kSrr)rrrr	r%;r*zCompareValue._compareNotEqualN)rr
rrr$r%rrrr	r/src@s(eZdZdZdd�Zdd�Zdd�ZdS)	�BooleanValuea^
    Provide boolean XPath expression operators.

    @ivar lhs: Left hand side expression of the operator.
    @ivar op: The operator. One of C{'and'}, C{'or'}.
    @ivar rhs: Right hand side expression of the operator.
    @ivar value: Reference to the method that will calculate the value of
                 this expression given an element.
    cCr )N�and)r"r#�_booleanAndr
�
_booleanOrr&rrr	rJr(zBooleanValue.__init__cCs|j�|�o|j�|�S)z�
        Calculate boolean and of the given expressions given an element.

        @param elem: The element to calculate the value of the expression from.
        r)rrrr	r-R�zBooleanValue._booleanAndcCs|j�|�p|j�|�S)z�
        Calculate boolean or of the given expressions given an element.

        @param elem: The element to calculate the value of the expression from.
        r)rrrr	r.Zr/zBooleanValue._booleanOrN)rr
r�__doc__rr-r.rrrr	r+?s

r+cCsd|}t�|�}|S)z;
    Internal method which selects the function object
    z_%s_Function)�globals)�fname�	klassname�crrr	�Functioncsr5c@r)�
_not_FunctioncCs
d|_dSr��	baseValue�rrrr	rm�
z_not_Function.__init__cCs
||_dSrr7)rr8rrr	�	setParamspr:z_not_Function.setParamscCs|j�|�Sr)r8r
rrrr	r
s�z_not_Function.valueN)rr
rrr;r
rrrr	r6lsr6c@r)�_text_FunctioncCsdSrrr9rrr	r;xrz_text_Function.setParamscCst|�Sr)�strrrrr	r
{�z_text_Function.valueN)rr
rr;r
rrrr	r=wrr=c@�<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�	_LocationcC�g|_d|_d|_dSr��
predicates�elementName�
childLocationr9rrr	r��
z_Location.__init__cCs:|jdkr
|j|jkr
dS|jD]
}|�|�sdSqdS�Nrr)rE�namerDr
�rr�prrr	�matchesPredicates�s

�z_Location.matchesPredicatescCs@|�|�sdS|jdkr|��D]}|j�|�rdSqdSdSrH)rLrF�elements�matches�rrr4rrr	rN�s

��z_Location.matchescCsJ|�|�sdS|jdkr|��D]	}|j�||�qdS|�t|��dSr)rLrFrM�queryForString�writer>)rr�	resultbufr4rrr	rP�s

�z_Location.queryForStringcCsF|�|�sdS|jdkr|��D]	}|j�||�qdS|�|�dSr)rLrFrM�
queryForNodes�append�rr�
resultlistr4rrr	rS�s

�z_Location.queryForNodescCs\|�|�sdS|jdkr|��D]	}|j�||�qdS|jD]}t|t�r+|�|�qdSr)rLrFrM�queryForStringListr�
isinstancer>rTrUrrr	rW�s

�


��z_Location.queryForStringListN)	rr
rrrLrNrPrSrWrrrr	rAs



rAc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_AnyLocationcCrBrrCr9rrr	r�rGz_AnyLocation.__init__cCs |jD]
}|�|�s
dSqdSrH)rDr
rJrrr	rL�s


�z_AnyLocation.matchesPredicatescCs(|jdkr|�|j|�|�|j�dSr)�parent�listParentsrTrI)rr�
parentlistrrr	r[�s
z_AnyLocation.listParentscCsV|jdks|j|jkr)|�|�r)|jdkr'|��D]}|j�|�r$dSqdSdSdS�NTF�rErIrLrFrMrNrOrrr	�isRootMatch�s�
��z_AnyLocation.isRootMatchcCsx|jdks|j|jkr*|�|�r*|jdkr(|��D]}|j�|�r%|SqdS|S|��D]}|�|�r9|Sq.dSrr^rOrrr	�findFirstRootMatch�s�
�
�z_AnyLocation.findFirstRootMatchcCs0|�|�rdS|��D]
}|�|�rdSqdSr])r_rMrNrOrrr	rN�s

�z_AnyLocation.matchescCstd��)Nz2queryForString is not implemented for any location)�NotImplementedError)rrrRrrr	rPr?z_AnyLocation.queryForStringcCs2|�|�r
|�|�|��D]}|�||�qdSr)r_rTrMrSrUrrr	rSs


�z_AnyLocation.queryForNodescCsH|�|�r|jD]}t|t�r|�|�q|��D]}|�||�qdSr)r_rrXr>rTrMrWrUrrr	rW
s



��z_AnyLocation.queryForStringListN)rr
rrrLr[r_r`rNrPrSrWrrrr	rY�s
	rYc@r@)�
XPathQuerycCs4||_ddlm}m}|||��}t|d��|_dS)Nr)�XPathParser�XPathParserScanner�XPATH)�queryStr�twisted.words.xish.xpathparserrcrd�getattr�baseLocation)rrfrcrd�parserrrr	rszXPathQuery.__init__cCs
|j��Sr)rf�__hash__r9rrr	rkr:zXPathQuery.__hash__cCs|j�|�Sr)rirNrrrr	rN"rzXPathQuery.matchescCst�}|j�||�|��Sr)rrirP�getvalue�rr�resultrrr	rP%szXPathQuery.queryForStringcC�&g}|j�||�t|�dkrdS|S�Nr)rirS�lenrmrrr	rS*�
zXPathQuery.queryForNodescCrorp)rirWrqrmrrr	rW2rrzXPathQuery.queryForStringListN)	rr
rrrkrNrPrSrWrrrr	rbsrbcCs|tvr
t|�t|<t|Sr)�__internedQueriesrb)�queryStringrrr	�internQuery>srucC�t|��|�Sr)rurN��xpathstrrrrr	rNDr<rNcCrvr)rurWrwrrr	rWHr<rWcCrvr)rurPrwrrr	rPLr<rPcCrvr)rurSrwrrr	rSPr<rSN)r0�iorr>rrrrr+r5r6r=rArYrbrsrurNrWrPrSrrrr	�<module>s&	$	>Y%

Anon7 - 2022
AnonSec Team