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__/pbsupport.cpython-310.pyc
o

�b�%�@s�dZddlmZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZmZmZGd	d
�d
e
j�Zeej�Gdd�de
j��ZGd
d�deje
j�Zedd�Zeej�Gdd�de
j��ZdS)z2
L{twisted.words} support for Instance Messenger.
�)�implementer)�defer�error)�log)�Failure)�pb)�basesupport�
interfaces)�AWAY�OFFLINE�ONLINEc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�TwistedWordsPersonzHI a facade for a person you can talk to through a twisted.words service.cCstj�|||�t|_dS�N)r�AbstractPerson�__init__r�status)�self�name�wordsAccount�r�</usr/lib/python3/dist-packages/twisted/words/im/pbsupport.pyr�
zTwistedWordsPerson.__init__cCs|jtkp	|jtkSr)rrr
�rrrr�isOnline�zTwistedWordsPerson.isOnlinecCs|jSr)rrrrr�	getStatusszTwistedWordsPerson.getStatuscCsF|r|jjj�|j||�}|�|jd|�|S|jjj�d|j|�S)zReturn a deferred...�* �
directMessage)�account�client�perspectiverr�
addErrback�metadataFailed�
callRemote�r�text�metadata�drrr�sendMessage!s
�zTwistedWordsPerson.sendMessagecCs"td|d|�|jjj�|j|�S)N�result:�text:)�printrrr rr�r�resultr%rrrr",sz!TwistedWordsPerson.metadataFailedcCs||_|j���|�dSr)r�chat�getContactsList�setContactStatus)rrrrr�	setStatus0szTwistedWordsPerson.setStatusN)
�__name__�
__module__�__qualname__�__doc__rrrr(r"r1rrrrr
sr
c@sFeZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�TwistedWordsGroupcCstj�|||�d|_dS�Nr)r�
AbstractGroupr�joined)rr�wordsClientrrrr7rzTwistedWordsGroup.__init__NcCsH|r|jjj�d|j||�}|�|jd|�|S|jjj�d|j|�S)zReturn a deferred.�groupMessager)rrr r#rr!r"r$rrr�sendGroupMessage;s

�
�z"TwistedWordsGroup.sendGroupMessagecCs$|jjj�d||jjd�|j�dS)N�setGroupMetadata)�topic�topic_author�rrr r#r)rr%rrr�setTopicIs

�zTwistedWordsGroup.setTopiccCs$td|d|�|jjj�d|j|�S)Nr)r*r;)r+rrr r#rr,rrrr"Ps
�z TwistedWordsGroup.metadataFailedcC�
d|_dS)N��r9rrrr�joiningV�
zTwistedWordsGroup.joiningcCrBr7rDrrrr�leavingYrFzTwistedWordsGroup.leavingcCs|jjj�d|j�S�N�
leaveGroupr@rrrr�leave\rzTwistedWordsGroup.leaver)
r2r3r4rr<rAr"rErGrJrrrrr65s
r6c@s�eZdZdZd'dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	d'dd�Z
dd�Zdd�Zdd�Z
d'dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdS)(�TwistedWordsClientz�In some cases, this acts as an Account, since it a source of text
    messages (multiple Words instances may be on a single PB connection)
    NcCs:d�|j||�|_||_td||�||_||_||_dS)Nz
{} ({}:{})zHELLO I AM A PB SERVICE)�format�accountNamerr+r.r�_logonDeferred)r�acct�serviceName�perspectiveName�chatuirNrrrres�
zTwistedWordsClient.__init__cC�|j�||�Sr)r.�	getPerson�rrrrrrTq�zTwistedWordsClient.getPersoncCrSr)r.�getGrouprUrrrrWtrVzTwistedWordsClient.getGroupcCs|j�|�|��Sr)r.�getGroupConversationrWrUrrrrXw�z'TwistedWordsClient.getGroupConversationcCs|j�d|�dS)N�
addContact)r r#rUrrrrZzrYzTwistedWordsClient.addContactcC� td||�|�|��|�dS)Nzreceived group members:)r+rX�setGroupMembers)r�names�grouprrr�remote_receiveGroupMembers}�z-TwistedWordsClient.remote_receiveGroupMemberscCs(td||||�|�|��|||�dS)Nzreceived a group message)r+rX�showGroupMessage)r�senderr^�messager&rrr�remote_receiveGroupMessage�sz-TwistedWordsClient.remote_receiveGroupMessagecCr[)Nz
member joined)r+rX�memberJoined�r�memberr^rrr�remote_memberJoined�r`z&TwistedWordsClient.remote_memberJoinedcCstd�|�|��|�dS)Nzmember left)r+rX�
memberLeftrfrrr�remote_memberLeft�sz$TwistedWordsClient.remote_memberLeftcCs|j�||��|�dSr�r.rTr1)rrrrrr�remote_notifyStatusChanged�sz-TwistedWordsClient.remote_notifyStatusChangedcCs"|j�|j�||���||�dSr)r.�getConversationrT�showMessage)rrrcr&rrr�remote_receiveDirectMessage�s�z.TwistedWordsClient.remote_receiveDirectMessagecCs&|D]\}}|j�||��|�qdSrrk)r�clistrrrrr�remote_receiveContactList�s�z,TwistedWordsClient.remote_receiveContactListcCs.d|vr|�|��|d|�dd��dSdS)Nr>r?)rXrA�get)r�dict_�	groupNamerrr�remote_setGroupMetadata�s

��z*TwistedWordsClient.remote_setGroupMetadatacC�&|�|���|j�d|��|j|�S)N�	joinGroup)rWrEr r#�addCallback�_cbGroupJoinedrUrrrrw���zTwistedWordsClient.joinGroupcCrvrH)rWrGr r#rx�_cbGroupLeftrUrrrrI�rzzTwistedWordsClient.leaveGroupcCs0|j�|�|��}|�dd�|j�d|�dS)N�sysz
you joined�getGroupMembers)r.rXrWrar r#�rr-r�	groupConvrrrry�sz!TwistedWordsClient._cbGroupJoinedcCs.td|�|j�|�|�d�}|�dd�dS)N�leftrCr|zyou left)r+r.rXrWrar~rrrr{�s
zTwistedWordsClient._cbGroupLeftcCs4td|�|jdur|j�|�||_|j��dS)NzConnected Words Client!)r+rN�callbackr r.r/)rr rrr�	connected�s


zTwistedWordsClient.connectedr)r2r3r4r5rrTrWrXrZr_rdrhrjrlrorqrurwrIryr{r�rrrrrK`s(


rKN)�
twisted.wordsztwisted.realityc@sTeZdZdZeZeZ	ddd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�ZdS)�	PBAccount�PBNc	CsXtj�|||||||�g|_|sdd|fg}|D]\}}	}
|j�t||	|
g�qdS)z_
        @param username: The name of your PB Identity.
        @type username: string
        r�N)r�AbstractAccountr�services�append�pbFrontEnds)rrM�	autoLogin�username�password�host�portr��serviceTyperPrQrrrr�s���zPBAccount.__init__csN�js"�js"d�_����}|��j���fdd�}|�|�|St�d��)z
        @returns: this breaks with L{interfaces.IAccount}
        @returntype: DeferredList of L{interfaces.IClient}s
        rCcs6|D]\}}|r��|���|�qt�|�qdSr)�registerAccountClient�	_cb_logOnr�err)�results�successr-�rRrrr�registerMany�s
�z%PBAccount.logOn.<locals>.registerManyzConnection in progress)�
_isConnecting�	_isOnline�_startLogOnr!�_loginFailedrxr�ConnectionError)rrRr'r�rr�r�logOn�s


zPBAccount.logOncCsdSrrrrrr�logOff�szPBAccount.logOffcCs6tddd�t�|j|j�}|j|j|j|fd�|S)Nz
Connecting...� ��end��callbackArgs)r+r�getObjectAtr�r��addCallbacks�_cbConnected�_ebConnected)rrRr'rrrr��szPBAccount._startLogOncCs@td�tddd�t�||j|j�}|j|j|j|fd�|S)Nz
Connected!zIdentifying...r�r�r�)r+r�authIdentityr�r�r��_cbIdentr�)r�rootrRr'rrrr��s
zPBAccount._cbConnectedc	Cs�|std�|�ttd���Std�g}|jD]"\}}}t��}|�|�||||||�}|�d|||��	|j
�qt�|�S)Nzfalsely identified.zusername or password incorrectzIdentified!�attach)r+r�r�	Exceptionr�r�Deferredr�r#rxr��DeferredList)	r�identrR�dl�handlerClass�sname�pnamer'�handlerrrrr�s
�
�
zPBAccount._cbIdentcCstd�|S)NzNot connected.)r+)rrrrrr�szPBAccount._ebConnectedr)r2r3r4�gatewayTyper6�
_groupFactoryr
�_personFactoryrr�r�r�r�r�r�rrrrr��s
�r�)r5�zope.interfacer�twisted.internetrr�twisted.pythonr�twisted.python.failurer�twisted.spreadr�twisted.words.imrr	�twisted.words.im.localsr
rrrr
�IGroupr8r6�
Referenceable�AbstractClientMixinrKr��IAccountr�r�rrrr�<module>s!*
]

Spamworldpro Mini