403Webshell
Server IP : 172.67.201.108  /  Your IP : 216.73.217.123
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.9/site-packages/elementpath/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/elementpath/__pycache__/schema_proxy.cpython-39.opt-1.pyc
a

���c��@s�ddlmZmZddlmZmZmZmZmZddl	m
Z
ddlmZm
Z
mZmZmZddlmZddlmZGdd	�d	ed
�Zd	gZdS)�)�ABCMeta�abstractmethod)�Any�Dict�List�Optional�Iterator�)�ElementPathTypeError)�ElementProtocol�XsdTypeProtocol�XsdAttributeProtocol�XsdElementProtocol�XMLSchemaProtocol)�is_etree_element)�XPathSchemaContextc@seZdZdZd#eeedd�dd�Zdd�dd�Zd	d
�Z	d$e
eee
e
fd�dd
�Ze
dd��Ze
eed�dd�Ze
eed�dd�Ze
eed�dd�Ze
eeed�dd�Zeee
ed�dd��Zeee
ed�dd��Zeeed�dd��Zeeed �d!d"��ZdS)%�AbstractSchemaProxyz�
    Abstract base class for defining schema proxies.

    :param schema: a schema instance that implements the `AbstractEtreeElement` interface.
    :param base_element: the schema element used as base item for static analysis.
    N)�schema�base_element�returncCs>t|�std�|���|dur.t|�s.td��||_||_dS)Nz1argument {!r} is not a compatible schema instancez<argument 'base_element' is not a compatible element instance)rr
�format�_schema�
_base_element)�selfrr�r�</usr/lib/python3.9/site-packages/elementpath/schema_proxy.py�__init__s��zAbstractSchemaProxy.__init__)rcCsJ|j|ur||_|jj��|_|��D]}|�|j�q&|�|j�|_dS)z�
        Binds a parser instance with schema proxy adding the schema's atomic types constructors.
        This method can be redefined in a concrete proxy to optimize schema bindings.

        :param parser: a parser instance.
        N)	r�	__class__Zsymbol_table�copy�iter_atomic_typesZschema_constructor�nameZcreate_tokenizerZ	tokenizer)r�parser�xsd_typerrr�bind_parser)s
zAbstractSchemaProxy.bind_parsercCst|j|jd�S)zx
        Get a context instance for static analysis phase.

        :returns: an `XPathSchemaContext` instance.
        )�root�item)rrr�rrrr�get_context8szAbstractSchemaProxy.get_context)�path�
namespacescCs|j�||�S)aV
        Find a schema element or attribute using an XPath expression.

        :param path: an XPath expression that selects an element or an attribute node.
        :param namespaces: an optional mapping from namespace prefix to namespace URI.
        :return: The first matching schema component, or ``None`` if there is no match.
        )r�find)rr(r)rrrr*@szAbstractSchemaProxy.findcCs|jjS)z(The XSD version, returns '1.0' or '1.1'.)r�xsd_versionr&rrrr+JszAbstractSchemaProxy.xsd_version)�qnamercCs|jjj�|�S)ah
        Get the XSD global type from the schema's scope. A concrete implementation must
        return an object that supports the protocols `XsdTypeProtocol`, or `None` if
        the global type is not found.

        :param qname: the fully qualified name of the type to retrieve.
        :returns: an object that represents an XSD type or `None`.
        )r�maps�types�get�rr,rrr�get_typeOs	zAbstractSchemaProxy.get_typecCs|jjj�|�S)a�
        Get the XSD global attribute from the schema's scope. A concrete implementation must
        return an object that supports the protocol `XsdAttributeProtocol`, or `None` if
        the global attribute is not found.

        :param qname: the fully qualified name of the attribute to retrieve.
        :returns: an object that represents an XSD attribute or `None`.
        )rr-Z
attributesr/r0rrr�
get_attributeZs	z!AbstractSchemaProxy.get_attributecCs|jjj�|�S)a�
        Get the XSD global element from the schema's scope. A concrete implementation must
        return an object that supports the protocol `XsdElementProtocol` interface, or
        `None` if the global element is not found.

        :param qname: the fully qualified name of the element to retrieve.
        :returns: an object that represents an XSD element or `None`.
        )rr-�elementsr/r0rrr�get_elementes	zAbstractSchemaProxy.get_elementcCs|jjj�|�S)a�
        Get a substitution group. A concrete implementation must returns a list containing
        substitution elements or `None` if the substitution group is not found. Moreover each item
        of the returned list must be an object that implements the `AbstractXsdElement` interface.

        :param qname: the fully qualified name of the substitution group to retrieve.
        :returns: a list containing substitution elements or `None`.
        )rr-Zsubstitution_groupsr/r0rrr�get_substitution_groupps	z*AbstractSchemaProxy.get_substitution_group)�obj�
type_qnamercCsdS)z�
        Returns `True` if *obj* is an instance of the XSD global type, `False` if not.

        :param obj: the instance to be tested.
        :param type_qname: the fully qualified name of the type used to test the instance.
        Nr�rr6r7rrr�is_instance{szAbstractSchemaProxy.is_instancecCsdS)a�
        Converts *obj* to the Python type associated with an XSD global type. A concrete
        implementation must raises a `ValueError` or `TypeError` in case of a decoding
        error or a `KeyError` if the type is not bound to the schema's scope.

        :param obj: the instance to be casted.
        :param type_qname: the fully qualified name of the type used to convert the instance.
        Nrr8rrr�cast_as�szAbstractSchemaProxy.cast_ascCsdS)z�
        Returns an iterator for not builtin atomic types defined in the schema's scope. A concrete
        implementation must yields objects that implement the protocol `XsdTypeProtocol`.
        Nrr&rrrr�sz%AbstractSchemaProxy.iter_atomic_types)r"rcCsdS)a]
        Returns the type at base of the definition of an XSD type. For an atomic type
        is effectively the primitive type. For a list is the primitive type of the item.
        For a union is the base union type. For a complex type is xs:anyType.

        :param xsd_type: an XSD type instance.
        :return: an XSD type instance.
        Nr)rr"rrr�get_primitive_type�sz&AbstractSchemaProxy.get_primitive_type)N)N)�__name__�
__module__�__qualname__�__doc__rrrrr#r'�strrr*�propertyr+rr1r
r2rr4rr5rr�boolr9r:rrr;rrrrrs,��


r)�	metaclassN)�abcrr�typingrrrrr�
exceptionsr
Z	protocolsrrr
rrZxpath_nodesrZ
xpath_contextrr�__all__rrrr�<module>
s

Youez - 2016 - github.com/yon3zu
LinuXploit