%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/words/xish/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/words/xish/__pycache__/domish.cpython-312.pyc

�

Ϫ�f�s��>�dZddlmZddlmZmZmZddlmZd�Z	ddiZ
Gd�d	�ZeZdd
�Z
d�Zd�Zd
�Zd�ZGd�de�ZGd�d�ZGd�de�Zee�Gd�d��ZGd�de�Zd�ZGd�dej4�ZGd�d�Zy) z�
DOM-like XML processing support.

This module provides support for parsing XML into DOM-like object structures
and serializing such structures to an XML string representation, optimized
for use in streaming XML applications.
�)�cast)�	Attribute�	Interface�implementer)�suxc�T�|jdd�}t|�dk(r|Sd|dfS)zSInternal method for splitting a prefixed Element name into its
    respective parts�:��Nr)�split�len)�name�ntoks  �;/usr/lib/python3/dist-packages/twisted/words/xish/domish.py�_splitPrefixrs2���:�:�c�1��D�
�4�y�A�~����d�1�g���z$http://www.w3.org/XML/1998/namespace�xmlc�2�eZdZdZdd�Zd�Zd�Zd�Zd	d�Zy)
�_ListSerializerz=Internal class which serializes an Element tree into a bufferNc���g|_i|_|r|jj|�|jjt�tj	�g|xsgz|_d|_y�Nr)�	writelist�prefixes�update�
G_PREFIXES�values�prefixStack�
prefixCounter)�selfr�prefixesInScopes   r�__init__z_ListSerializer.__init__'s]�������
���M�M� � ��*��
�
���Z�(�&�-�-�/�0�O�4I�r�J�����rc�8�dj|j�S)N�)�joinr�rs r�getValuez_ListSerializer.getValue0s���w�w�t�~�~�&�&rc��||jvr0d|jz|j|<|jdz|_|j|S)Nzxn%dr
)rr�r�uris  r�	getPrefixz_ListSerializer.getPrefix3sI���d�m�m�#�!'�4�+=�+=�!>�D�M�M�#��!%�!3�!3�a�!7�D���}�}�S�!�!rc��|j}tdt|j�dzdzd�D]}|||vs�yy)N���r
TF�r�ranger
�r�prefix�stack�is    r�
prefixInScopez_ListSerializer.prefixInScope9sN��� � ���r�C�� 0� 0�1�A�5��;�R�@�	�A���q��!��	�rc��|jj}t|t�r	||�yt|t�r|t|��y|j}|j}|j|}}|jj�D]\}}	||j|	<�|jjt|jj���|�|}|�|}d}
||k7s||jvr"|j|�}
|j!|
�}|
s|d|z�n?|d|
�d|���s/|d|
�d|�d��|jdj|
�d}||k7r||k7s|
rs|d	|z�|jj�D]\}}	|d|�d|	�d���|j"j�D]�\}}
t|t$�rq|\}}|j|�}|j!|�s-|d|�d|�d��|jdj|�|d
|�d|�dt|
d��d����|d
|�dt|
d��d����|dk(r	|d
�yt'|j(�dkDrJ|d
�|j(D]}|j+||���|
s|d|z�n|d|
�d|�d
��n|d�|jj-�y)Nz<%s�<r	z xmlns:z='�'r,Tz xmlns='%s'� r
r�>)�
defaultUriz</%s>z</z/>)r�append�
isinstance�
SerializedXML�str�escapeToXmlrr)r9�
localPrefixes�itemsrr�list�keysr*r3�
attributes�tupler
�children�	serialize�pop)r�elem�closeElementr9�writerr)�currentDefaultUri�p�ur0�inScope�k�v�attr_uri�	attr_name�attr_prefix�cs                  rrFz_ListSerializer.serialize@s�����%�%���d�M�*��$�K���d�C� ��+�d�#�$���y�y���h�h��(,����%�
��&�&�,�,�.�	!�D�A�q� �D�M�M�!��	!�������T�%7�%7�%<�%<�%>� ?�@���*�J��;��C����*���t�}�}� 4��^�^�C�(�F��(�(��0�G���%�4�.�!��A�f�X�Q�t�f�%�&�����x�r�#��a�0�1�� � ��$�+�+�F�3����*�*��:��V�7��-�:�.�/��&�&�,�,�.�	'�D�A�q��G�A�3�b���1�%�&�	'��O�O�)�)�+�	5�D�A�q��!�U�#�&'�#��)�"�n�n�X�6���)�)�+�6��G�K�=��8�*�A�>�?��$�$�R�(�/�/��<���+��a�	�{�"�[��A�5F�4G�q�I�J���!��B�{�1�a�0�1��3�4�	5� �1���#�J���t�}�}���!��#�J��]�]�
9�����q�Z��8�
9���g��&�'���6�(�!�D�6��+�,��$�K������r�NN)r
r#)	�__name__�
__module__�__qualname__�__doc__r!r&r*r3rF�rrrr$s��G��'�"��Yrrc���|jdd�}|jdd�}|jdd�}|dk(r$|jdd	�}|jd
d�}|S)aEscape text to proper XML form, per section 2.3 in the XML specification.

    @type text: C{str}
    @param text: Text to escape

    @type isattrib: C{bool}
    @param isattrib: Triggers escaping of characters necessary for use as
                     attribute values
    �&�&amp;r5�&lt;r8�&gt;r
r6�&apos;�"�&quot;��replace)�text�isattribs  rr>r>�s`���<�<��W�%�D��<�<��V�$�D��<�<��V�$�D��1�}��|�|�C��*���|�|�C��*���Krc��|jdd�}|jdd�}|jdd�}|jdd�}|jd	d
�}|S)Nr^r5r_r8r`r6rbrar]r\rc�res r�unescapeFromXmlri�sW���<�<���$�D��<�<���$�D��<�<��#�&�D��<�<��#�&�D��<�<���%�D��Krc#�FK�|D]}|j|�s�|���y�w)z Filters items in a list by classN)�
providedBy)rA�int�ns   r�generateOnlyInterfacern�s&����
����>�>�!���G��s�!�!c#�K�|D]<}tj|�s�|j|k(s�)|j|k(s�9|���>y�w)z;Filters Element items in a list with matching name and URI.N)�IElementrkrr))rArr)rms    r�generateElementsQNamedrq�s<����
������q�!�a�f�f��n����#���G��s�A�A�A�Ac#�nK�|D],}tj|�s�|j|k(s�)|���.y�w)zFFilters Element items in a list with matching name, regardless of URI.N)rprkr)rArrms   r�generateElementsNamedrs�s2����
������q�!�a�f�f��n��G��s�5�5�5c��eZdZdZy)r<z/Marker class for pre-serialized XML in the DOM.N�rVrWrXrYrZrrr<r<�s��9�rr<c�"�eZdZdZd�Zd�Zd�Zy)�	Namespacez7Convenience object for tracking namespace declarations.c��||_y�N��_urir(s  rr!zNamespace.__init__�s	����	rc��|j|fSryrz�rrms  r�__getattr__zNamespace.__getattr__�����	�	�1�~�rc��|j|fSryrzr}s  r�__getitem__zNamespace.__getitem__�rrN)rVrWrXrYr!r~r�rZrrrwrw�s��A���rrwc��eZdZdZed�Zed�Zed�Zed�Zed�Z	ed�Z
ed�Zdd
�Zdd�Z
d�Zd
�Zy	)rpz�
    Interface to XML element nodes.

    See L{Element} for a detailed example of its general use.

    Warning: this Interface is not yet complete!
    z Element's namespace URI z Element's local name z) Default namespace URI of child elements z" Dictionary of element attributes z List of child nodes z' Reference to element's parent element z Dictionary of local prefixes Nc��y)a�Serializes object to a (partial) XML document

        @param prefixes: dictionary that maps namespace URIs to suggested
                         prefix names.
        @type prefixes: L{dict}

        @param closeElement: flag that determines whether to include the
            closing tag of the element in the serialized string. A value of
            C{0} only generates the element's start tag. A value of C{1} yields
            a complete serialization.
        @type closeElement: L{int}

        @param defaultUri: Initial default namespace URI. This is most useful
            for partial rendering, where the logical parent element (of which
            the starttag was already serialized) declares a default namespace
            that should be inherited.
        @type defaultUri: L{str}

        @param prefixesInScope: list of prefixes that are assumed to be
            declared by ancestors.
        @type prefixesInScope: L{list}

        @return: (partial) serialized XML
        @rtype: L{str}
        NrZ)rrIr9r s    r�toXmlzIElement.toXml���rc��y)a<
        Create an element and add as child.

        The new element is added to this element as a child, and will have
        this element as its parent.

        @param name: element name. This can be either a L{str} object that
            contains the local name, or a tuple of (uri, local_name) for a
            fully qualified name. In the former case, the namespace URI is
            inherited from this element.
        @type name: L{str} or L{tuple} of (L{str}, L{str})

        @param defaultUri: default namespace URI for child elements. If
            L{None}, this is inherited from this element.
        @type defaultUri: L{str}

        @param content: text contained by the new element.
        @type content: L{str}

        @return: the created element
        @rtype: object providing L{IElement}
        NrZ)rr9�contents   r�
addElementzIElement.addElementr�rc��y)a�
        Adds a node as child of this element.

        The C{node} will be added to the list of childs of this element, and
        will have this element set as its parent when C{node} provides
        L{IElement}. If C{node} is a L{str} and the current last child is
        character data (L{str}), the text from C{node} is appended to the
        existing last child.

        @param node: the child node.
        @type node: L{str} or object implementing L{IElement}
        NrZ)�nodes r�addChildzIElement.addChild'r�rc��y)aC
        Adds character data to this element.

        If the current last child of this element is a string, the text will
        be appended to that string. Otherwise, the text will be added as a new
        child.

        @param text: The character data to be added to this element.
        @type text: L{str}
        NrZrhs r�
addContentzIElement.addContent5r�r�Nr
r#NrU)rVrWrXrYrr)rr9rCrE�parentr?r�r�r�r�rZrrrprp�sj����3�
4�C��1�2�D��J�K�J��C�D�J��4�5�H�
�D�
E�F��B�C�M��6�0�
rrpc��eZdZdZdZdd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Ze
Zd�Z
dd�Zd
�Zd�Zd�Zd�Zdedefd�Zdd�Zd�Zd�Zdd�Zdd�Zd�Zy)�ElementaPRepresents an XML element node.

    An Element contains a series of attributes (name/value pairs), content
    (character data), and other child Element objects. When building a document
    with markup (such as HTML or XML), use this object as the starting point.

    Element objects fully support XML Namespaces. The fully qualified name of
    the XML Element it represents is stored in the C{uri} and C{name}
    attributes, where C{uri} holds the namespace URI. There is also a default
    namespace, for child elements. This is stored in the C{defaultUri}
    attribute. Note that C{''} means the empty namespace.

    Serialization of Elements through C{toXml()} will use these attributes
    for generating proper serialized XML. When both C{uri} and C{defaultUri}
    are not None in the Element and all of its descendents, serialization
    proceeds as expected:

      >>> from twisted.words.xish import domish
      >>> root = domish.Element(('myns', 'root'))
      >>> root.addElement('child', content='test')
      <twisted.words.xish.domish.Element object at 0x83002ac>
      >>> root.toXml()
      u"<root xmlns='myns'><child>test</child></root>"

    For partial serialization, needed for streaming XML, a special value for
    namespace URIs can be used: L{None}.

    Using L{None} as the value for C{uri} means: this element is in whatever
    namespace inherited by the closest logical ancestor when the complete XML
    document has been serialized. The serialized start tag will have a
    non-prefixed name, and no xmlns declaration will be generated.

    Similarly, L{None} for C{defaultUri} means: the default namespace for my
    child elements is inherited from the logical ancestors of this element,
    when the complete XML document has been serialized.

    To illustrate, an example from a Jabber stream. Assume the start tag of the
    root element of the stream has already been serialized, along with several
    complete child elements, and sent off, looking like this::

      <stream:stream xmlns:stream='http://etherx.jabber.org/streams'
                     xmlns='jabber:client' to='example.com'>
        ...

    Now suppose we want to send a complete element represented by an
    object C{message} created like:

      >>> message = domish.Element((None, 'message'))
      >>> message['to'] = 'user@example.com'
      >>> message.addElement('body', content='Hi!')
      <twisted.words.xish.domish.Element object at 0x8276e8c>
      >>> message.toXml()
      u"<message to='user@example.com'><body>Hi!</body></message>"

    As, you can see, this XML snippet has no xmlns declaration. When sent
    off, it inherits the C{jabber:client} namespace from the root element.
    Note that this renders the same as using C{''} instead of L{None}:

      >>> presence = domish.Element(('', 'presence'))
      >>> presence.toXml()
      u"<presence/>"

    However, if this object has a parent defined, the difference becomes
    clear:

      >>> child = message.addElement(('http://example.com/', 'envelope'))
      >>> child.addChild(presence)
      <twisted.words.xish.domish.Element object at 0x8276fac>
      >>> message.toXml()
      u"<message to='user@example.com'><body>Hi!</body><envelope xmlns='http://example.com/'><presence xmlns=''/></envelope></message>"

    As, you can see, the <presence/> element is now in the empty namespace, not
    in the default namespace of the parent or the streams'.

    @type uri: L{str} or None
    @ivar uri: URI of this Element's name

    @type name: L{str}
    @ivar name: Name of this Element

    @type defaultUri: L{str} or None
    @ivar defaultUri: URI this Element exists within

    @type children: L{list}
    @ivar children: List of child Elements and content

    @type parent: L{Element}
    @ivar parent: Reference to the parent Element, if any.

    @type attributes: L{dict}
    @ivar attributes: Dictionary of attributes associated with this Element.

    @type localPrefixes: L{dict}
    @ivar localPrefixes: Dictionary of namespace declarations on this
                         element. The key is the prefix to bind the
                         namespace uri to.
    rNc���|xsi|_|\|_|_|�8|j|jj�vr|j|_n||_|xsi|_g|_d|_y)a�
        @param qname: Tuple of (uri, name)
        @param defaultUri: The default URI of the element; defaults to the URI
                           specified in C{qname}
        @param attribs: Dictionary of attributes
        @param localPrefixes: Dictionary of namespace declarations on this
                              element. The key is the prefix to bind the
                              namespace uri to.
        N)r?r)rrr9rCrEr�)r�qnamer9�attribsr?s     rr!zElement.__init__�sj��+�0�b���#����$�)���$�(�(�$�2D�2D�2K�2K�2M�"M�"�h�h�D�O�(�D�O�!�-�R�����
���rc��|jD]+}tj|�s�|j|k(s�)|cS|j	d�rt|��y)N�_)rErprkr�
startswith�AttributeError)r�keyrms   rr~zElement.__getattr__�sN�����	�A��"�"�1�%�!�&�&�C�-���	��>�>�#�� ��%�%�rc�>�|j|j|�Sry�rC�_dqa�rr�s  rr�zElement.__getitem__�s�����t�y�y��~�.�.rc�<�|j|j|�=yryr�r�s  r�__delitem__zElement.__delitem__�s���O�O�D�I�I�c�N�+rc�@�||j|j|�<yryr�)rr��values   r�__setitem__zElement.__setitem__�s��*/�����	�	�#��'rc�N�|jD]}t|t�s�|cSy)z9
        Retrieve the first CData (content) node
        r#)rEr;r=r}s  r�__unicode__zElement.__unicode__�s+�����	�A��!�S�!���	�rc�6�t|�jd�S)zH
        Retrieve the first character data node as UTF-8 bytes.
        zutf-8)r=�encoder%s r�	__bytes__zElement.__bytes__�s���4�y����(�(rc�:�t|t�r
|ds|dS|S)z$Dequalify an attribute key as neededrr
)r;rD)r�attrs  rr�zElement._dqa�s ���d�E�"�4��7���7�N��Krc�:�|jj||�S)z.Retrieve the value of attribname, if it exists)rC�get)r�
attribname�defaults   r�getAttributezElement.getAttribute�s�����"�"�:�w�7�7rc�<�|j|�|jvS)z+Determine if the specified attribute exists)r�rC)r�attribs  r�hasAttributezElement.hasAttribute�s���y�y�� �D�O�O�3�3rc�^�|jj|j|�d�|k(S)zbSafely compare the value of an attribute against a provided value.

        L{None}-safe.
        N)rCr�r�)rr�r�s   r�compareAttributezElement.compareAttribute�s)��
���"�"�4�9�9�V�#4�d�;�u�D�Drc�@�|j}||}||||<|||<y)z!Swap the values of two attribute.N)rC)r�left�right�d�ls     r�swapAttributeValueszElement.swapAttributeValues�s*���O�O��
�d�G���E�(��$����%�rc�t�tj|�r||_|jj	|�|S)zAdd a child to this Element.)rprkr�rEr:)rr�s  rr�zElement.addChilds.�����t�$��D�K��
�
���T�"��rre�returnc�&�t|t�s%td|�dt|�j�d���|j
}t
|�dkDrt|dt�r|d|z|d<n|j|�tt|d�S)z#Add some text data to this Element.zExpected str not z (�)rr,)	r;r=�	TypeError�typerVrEr
r:r)rrerTs   rr�zElement.addContents����$��$��/��x�r�$�t�*�:M�:M�9N�a�P�Q�Q��M�M���q�6�A�:�*�Q�r�U�C�0��b�E�D�L�A�b�E�
�H�H�T�N��C��2���rc���t|t�r|�|d}t||�}n|�|j}t||f|�}|j	|�|r|j|�|Sr)r;rDr�r9r�r�)rrr9r��childs     rr�zElement.addElementsi���d�E�"��!�!�!�W�
��D�*�-�E��!�!�_�_�
��Z��.�
�;�E��
�
�e������W�%��rc�L�|jjt|��y)z=Add a pre-serialized chunk o' XML as a child of this Element.N)rEr:r<)r�rawxmlstrings  r�	addRawXmlzElement.addRawXml#s���
�
���]�<�8�9rc�|�dtjz|jd<tjdzt_y)z[Add a unique (across a given Python session) id attribute to this
        Element.
        zH_%d�idr
N)r��
_idCounterrCr%s r�addUniqueIdzElement.addUniqueId's0��!'��);�);� ;������$�/�/�!�3��rc�h�|�t|jt�St|j||�S)a�
        Iterate across all children of this Element that are Elements.

        Returns a generator over the child elements. If both the C{uri} and
        C{name} parameters are set, the returned generator will only yield
        on elements matching the qualified name.

        @param uri: Optional element URI.
        @type uri: L{str}
        @param name: Optional element name.
        @type name: L{str}
        @return: Iterator that yields objects implementing L{IElement}.
        )rnrErprq)rr)rs   r�elementszElement.elements.s-���<�(�����A�A�)�$�-�-��s�C�Crc�d�t||��}|j|||��|j�S)z4Serialize this Element and all children to a string.)rr )rIr9)�SerializerClassrFr&)rrrIr9r �ss      rr�z
Element.toXmlAs,���X��O��	���D�|�
��K��z�z�|�rc�X�|jD]}tj|�s�|cSyry)rErprk)rrTs  r�firstChildElementzElement.firstChildElementGs-�����	�A��"�"�1�%���	�r)NNNryrUr�)rVrWrXrYr�r!r~r�r�r�r�r��__str__r�r�r�r�r�r�r=r�r�r�r�r�r�r�rZrrr�r�Bs���`�D�J��(�/�,�0��)��G��8�4�E���	 �s�	 �s�	 ��":�4�D�&�rr�c��eZdZdZy)�ParserErrorz,Exception thrown when a parsing error occursNrurZrrr�r�Ns��6�rr�c�t�	t�}|S#t$r t�td��t�}|cYSwxYw)z�Preferred method to construct an ElementStream

    Uses Expat-based stream if available, and falls back to Sux if necessary.
    zNo parsers available :()�ExpatElementStream�ImportError�SuxElementStream�	Exception)�ess r�
elementStreamr�TsB��
�
�
!���	�����#��5�6�6�
�
���	�	�s��&7�7c�R�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dd	d
ddd
�Z
d�Zd�Zy)r�c��|j�d|_d|_d|_d|_d|_d|_g|_g|_y)NF)	�connectionMade�DocumentStartEvent�ElementEvent�DocumentEndEvent�currElem�rootElem�documentStarted�defaultNsStackrr%s rr!zSuxElementStream.__init__dsL������"&��� ��� $�����
���
�$��� �����rc��	|j|�y#tj$r}tt	|���d}~wwxYwry)�dataReceivedr�
ParseErrorr�r=�r�buffer�es   r�parsezSuxElementStream.parseos8��	&����f�%���~�~�	&��c�!�f�%�%��	&�s��A�;�Ac��|j}tdt|j�dzdzd�D]}|||vs�|||cSy)Nr,r
r-r/s    r�findUrizSuxElementStream.findUrius\��� � ���r�C�� 0� 0�1�A�5��;�R�@�	(�A���q��!��Q�x��'�'�	(�rc�6�d}i}i}d}t|j��D]2\}}|jd�s�t|�\}	}
|	�|}n|||
<||=�4|jj|�|�*t
|j�dkDr|jd}nd}t|�\}}|�|}n|j|�}|j�D]:\}}t|�\}
}|
�|||<�t|�||j|
�|f<�<t||f|||�}
|jj|�|jr5|j�|
|_y|jj|
�|_y|
|_d|_|j|
�y)N�xmlnsrr,r#T)rAr@r�rrr:r
r�r�rir�r�r�r�r�r�)rrrCr9r?r�r)rOrP�xrLr0rmr�s              r�gotTagStartzSuxElementStream.gotTagStart~s����
��
�������)�)�+�,�	"�D�A�q��|�|�G�$�#�A����1��9�!"�J�'(�M�!�$��q�M�	"�	
�����
�.����4�&�&�'�!�+�!�0�0��4�
��
�$�D�)�����>��C��,�,�v�&�C��$�$�&�	C�D�A�q���?�D�A�q��y����
�0?��0B�����a��1�,�-�	C�
�S�$�K��W�m�D��	
���"�"�:�.�����}�}�$� !��
�!%�
�
� 6� 6�q� 9��
��D�M�#'�D� ��#�#�A�&rc��|j�=t|t�r|jd�}|jj	|�yy�N�ascii�r�r;�bytes�decoder��r�datas  r�gotTextzSuxElementStream.gotText��;���=�=�$��$��&��{�{�7�+���M�M�$�$�T�*�%rc��|j�=t|t�r|jd�}|jj	|�yyr�r�r�s  r�gotCDatazSuxElementStream.gotCData�r�rc��yryrZr�s  r�
gotCommentzSuxElementStream.gotComment�s��rr\r5r8r6ra)�amp�lt�gt�apos�quotc���|tjvrPtj|}t|t�r|j	d�}|j
j
|�yyr�)r��entitiesr;r�r�r�r�)r�	entityRefr�s   r�gotEntityReferencez#SuxElementStream.gotEntityReference�sR���(�1�1�1�#�,�,�Y�7�D��$��&��{�{�7�+���M�M�$�$�T�*�	2rc��|j�td��t|�\}}|�|jd}n|j	|�}|j
�U|jj|k7s|jj|k7rtd��|j�d|_y|j
j|k7s|j
j|k7rtd��|jj�|jj�|j
j�>|j|j
_|j|j
�d|_y|j
j|_y)Nz%Element closed after end of document.r,zMismatched root elementszMalformed element close)
r�r�rr�r�r�rr)r�rrGr�r�)rrr0r)s    r�	gotTagEndzSuxElementStream.gotTagEnd�s>���=�=� ��E�F�F�$�D�)�����>��%�%�b�)�C��,�,�v�&�C��=�=� ��}�}�!�!�T�)�T�]�]�->�->�#�-E�!�"<�=�=��!�!�#� �D�M��}�}�!�!�T�)�T�]�]�->�->�#�-E�!�";�<�<�
��� � �"����#�#�%��}�}�#�#�+�'+�}�}��
�
�$��!�!�$�-�-�0� $��
�!%�
�
� 4� 4��
rN)
rVrWrXr!r�r�r�r�r�r�rrr	rZrrr�r�csH��	�&��='�~+�+�
�
������H�+�*5rr�c�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	r�c���ddl}d|_d|_d|_|j|_|jdd�|_|j|j_|j|j_
|j|j_|j|j_|j|j_d|_dg|_d|_i|_y)NrzUTF-8r7r#)�pyexpatr�r�r��error�ParserCreate�parser�_onStartElement�StartElementHandler�
_onEndElement�EndElementHandler�_onCdata�CharacterDataHandler�_onStartNamespace�StartNamespaceDeclHandler�_onEndNamespace�EndNamespaceDeclHandlerr�r�r�r?)rrs  rr!zExpatElementStream.__init__s����"&��� ��� $����]�]��
��*�*�7�C�8���*.�*>�*>����'�(,�(:�(:����%�+/�=�=����(�04�0F�0F����-�.2�.B�.B����+���
�!�d��� �����rc��	|jj|�y#|j$r}tt	|���d}~wwxYwry)r�Parser
r�r=r�s   rr�zExpatElementStream.parses<��	&��K�K���f�%���z�z�	&��c�!�f�%�%��	&�s��A�A�Ac�d�|jdd�}t|�dk(rd|f}i}g}|j�D]:\}}d|vs�|jdd�}|||d|df<|j|��<|j	|�|D]}||=�t||jd||j�}	i|_|jdk(rM|jdk7r6|jjj|	�|j|	_|	|_	yd|_|j|	�y)Nr7r
r#rr,)
�rsplitr
r@r:rr�r�r?r�r�rEr�r�)
rr�attrsr��newAttrs�toDeleterOrP�aqnamer�s
          rrz"ExpatElementStream._onStartElement$s4�����C��#���u�:��?���J�E������K�K�M�	#�D�A�q��a�x����#�q�)��34��&��)�V�A�Y�/�0�����"�		#�	���X���	�A��a��	�
�E�4�.�.�r�2�E�4�;M�;M�N��������1�$��}�}��$��
�
�&�&�-�-�a�0��=�=����D�M�$%�D� ��#�#�A�&rc���|j�|j�y|jj�#|j|j�d|_y|jj|_yry)r�r�r�r�)rr�s  rrz ExpatElementStream._onEndElementJsV���=�=� ��!�!�#��]�]�
!�
!�
)����d�m�m�,� �D�M�
!�M�M�0�0�D�Mrc�Z�|jdk7r|jj|�yyry)r�r�r�s  rrzExpatElementStream._onCdataZs%���=�=�D� ��M�M�$�$�T�*�!rc�^�|�|jj|�y||j|<yry)r�r:r?)rr0r)s   rrz$ExpatElementStream._onStartNamespace^s-���>����&�&�s�+�),�D���v�&rc�>�|�|jj�yyry)r�rG)rr0s  rrz"ExpatElementStream._onEndNamespacefs���>����#�#�%�rN)
rVrWrXr!r�rrrrrrZrrr�r�s&�� �$&�$'�L1� +�-�&rr�N)r)rY�typingr�zope.interfacerrr�twisted.webrrrrr�r>rirnrqrsr=r<rwrpr�r�r�r��	XMLParserr�r�rZrr�<module>r*s���
��<�<���5�e�
<�
�u�u�p"���&����	�C�	�
�
�\�y�\�~
�X��H�H��H�V	�)�	��e5�s�}�}�e5�P^&�^&r

Zerion Mini Shell 1.0