Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : fdshops ( 1003)
PHP Version : 8.2.21
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/offlineimap/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/offlineimap/threadutil.pyc
�
��Vc@sddlmZmZmZmZyddlmZmZWn'ek
reddlmZmZnXddl	Z	ddl
ZddlZddl
mZd�Zddd��YZed�ad	�Zd
�Zdefd��YZiZe�Zd
�Zdefd��YZdS(i����(tLocktThreadtBoundedSemaphoret
currentThread(tQueuetEmptyN(tgetglobaluicCsFxt|�D]}|j�q
Wxt|�D]}|j�q.WdS(sjBlock until `semaphore` gets back to its original state, ie all acquired
    resources have been released.N(trangetacquiretrelease(t	semaphoret
originalstateti((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pytsemaphorereset st
threadlistcBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(snStore the list of all threads in the software so it can be used to find out
    what's running and what's not.cCst�|_g|_dS(N(Rtlocktlist(tself((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyt__init__.scCs6|jj�z|jj|�Wd|jj�XdS(N(RRRtappendR	(Rtthread((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pytadd2s
cCs6|jj�z|jj|�Wd|jj�XdS(N(RRRtremoveR	(RR((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR9s
cCsF|jj�z$t|j�s#dS|jj�SWd|jj�XdS(N(RRtlenRtNonetpopR	(R((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR@s
cCs*x#|j�}|sdS|j�qdS(N(Rtjoin(RR((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pytresetIs
(t__name__t
__module__t__doc__RRRRR(((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR*s					idcCsSt}xF|rNy(tjtd�}||�tk}Wq	tk
rJq	Xq	WdS(sKAn infinite "monitoring" loop watching for finished ExitNotifyThread's.

    This one is supposed to run in the main thread.
    :param callback: the function to call when a thread terminated. That
                     function is called with a single argument -- the
                     ExitNotifyThread that has terminated. The monitor will
                     not continue to monitor for other threads until
                     'callback' returns, so if it intends to perform long
                     calculations, it should start a new thread itself -- but
                     NOT an ExitNotifyThread, or else an infinite loop
                     may result.
                     Furthermore, the monitor will hold the lock all the
                     while the other thread is waiting.
    :type callback:  a callable function
    i<N(tTruetexitthreadstgetR(tcallbacktdo_looptthrd((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pytexitnotifymonitorloopWs	
cCsrt�}|jrJt|jt�r-t�n|j|�tjd�n$|jdkr]tS|j	|�t
SdS(sOCalled when a thread exits.

    Main thread is aborted when this returns True.idtSYNCRUNNER_EXITED_NORMALLYN(Rtexit_exceptiont
isinstancet
SystemExittthreadExceptiontsystexittexit_messageRtthreadExitedtFalse(Rtui((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pytthreadexitedvs			

tExitNotifyThreadcBs_eZdZdZd�Zd�Zdd�Zed��Z	ed��Z
ed��ZRS(sdThis class is designed to alert a "monitor" to the fact that a
    thread has exited and to provide for the ability for it to find out
    why.  All instances are made daemon threads (setDaemon(True), so we
    bail out when the mainloop dies.

    The thread can set instance variables self.exit_message for a human
    readable reason of the thread exit.cOsEtt|�j||�|jt�d|_d|_d|_dS(N(	tsuperR2Rt	setDaemonRRR-t	_exit_exct_exit_stacktrace(Rtargstkwargs((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR�s

		cCs
y�tjstj|�n�yddl}Wntk
rKddl}nX|j�}y|jdt	�t
��}Wntk
r�nX|jt
jjtjd|j|j�f��Wn/tk
r�}tj�}|j||�nXtr	tj|t�ndS(Ni����sThread.run(self)s
%s_%s.prof(R2t
profiledirRtruntcProfiletImportErrortprofiletProfiletrunctxtglobalstlocalsR)t
dump_statstostpathRtidenttgetNamet	Exceptiont	tracebackt
format_exctset_exit_exceptionR tputR(RR=tproftettb((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR:�s&	

!cCs||_||_dS(sbSets Exception and stacktrace of a thread, so that other
        threads can query its exit statusN(R5R6(Rtexctst((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyRJ�s	cCs|jS(s�Returns the cause of the exit, one of:
        Exception() -- the thread aborted with this exception
        None -- normal termination.(R5(R((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR'�scCs|jS(s4Returns a string representing the stack trace if set(R6(R((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pytexit_stacktrace�scCs
||_dS(s6If set, will output profile information to 'directory'N(R9(tclst	directory((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pytset_profiledir�sN(
RRRRR9RR:RJtpropertyR'RQtclassmethodRT(((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR2�s			cCs7tj�|tkr)t|�t|<ntj�dS(syInitialize the instance-limited thread implementation to permit
    up to intancemax threads with the given instancename.N(tinstancelimitedlockRtinstancelimitedsemsRR	(tinstancenametinstancemax((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pytinitInstanceLimit�s
tInstanceLimitedThreadcBs#eZd�Zd�Zd�ZRS(cOs&||_tt|�j||�dS(N(RYR3R\R(RRYR7R8((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR�s	cCs"t|jj�tj|�dS(N(RXRYRR2tstart(R((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR]�scCs@ztj|�Wdtr;t|jr;t|jj�nXdS(N(R2R:RXRYR	(R((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR:�s(RRRR]R:(((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyR\�s		((t	threadingRRRRRRR<tqueueRHtos.pathRCR+tofflineimap.uiRR
RR R%R1R2RXRWR[R\(((s:/usr/lib/python2.7/site-packages/offlineimap/threadutil.pyt<module>s$"
	
+		N			

Spamworldpro Mini