%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/mailman/Mailman/Queue/
Upload File :
Create Path :
Current File : //lib/mailman/Mailman/Queue/Runner.pyo

�
��ac@s�dZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
l
mZddlZyeefWnek
r�dZdZnXd
dd��YZdS(sGeneric queue runner class.
i����N(tStringIO(tmm_cfg(tUtils(tErrors(tMailList(ti18n(tsyslog(tSwitchboardiitRunnercBs�eZdZejZddd�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d�Zd	�Zd
�Zd�Zd�Zd
�ZRS(icCsCi|_t|j||t�|_ttj�|_t|_	dS(N(
t_kidsRtQDIRtTruet_switchboardRtSHUNTQUEUE_DIRt_shunttFalset_stop(tselftslicet	numslices((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyt__init__0s	cCsd|jjt|�fS(Ns
<%s at %s>(t	__class__t__name__tid(R((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyt__repr__9scCs
t|_dS(N(RR(R((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pytstop<scCskzYyAx:trB|j�}|j�|jr2Pn|j|�q	WWntk
rWnXWd|j�XdS(N(Rt_oneloopt_doperiodicRt_snoozetKeyboardInterruptt_cleanup(Rtfilecnt((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pytrun?s	
	
cCs�|jj�}x�|D]�}y|jj|�\}}Wnqtk
r�}|j|�tjrytdd|�t}ntdd|�t	}|jj
|d|�qnXy$|j||�|jj
|�Wn�tk
r�}|j|�|jj�|d<y9|j
j||�}tdd|�|jj
|�Wq�tk
r�}|j|�tdd|�|jj
|dt�q�XnXtj|jdt�|j�|j�rPqqWt|�S(	Nterrors/Skipping and preserving unparseable message: %ss Ignoring unparseable message: %stpreservetwhichqsSHUNTING: %ss.SHUNTING FAILED, preserving original entry: %stonce(Rtfilestdequeuet	Exceptiont_logRtQRUNNER_SAVE_BAD_MESSAGESRRRtfinisht_onefileR#RtenqueueRtreapR	Rt
_shortcircuittlen(RR%tfilebasetmsgtmsgdatateR"tnew_filebase((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyRYsJ

		



c
Cs|jd�}|s!tj}n|j|�}|s]tdd|�|jj||�dStj�}|j	�}|r�|j
|�}n	tj}tj|�||d<z|j
|||�}Wdtj|�X|jd�}	|	r�|jj|	�n|r|jj||�ndS(NtlistnameR!s/Dequeuing message destined for missing list: %stlangR	(tgetRtMAILMAN_SITE_LISTt
_open_listRRR,Rtget_translationt
get_sendertgetMemberLanguagetDEFAULT_SERVER_LANGUAGEtset_languaget_disposetset_translationR	tupdateR(
RR1R2R5tmlisttotranslationtsenderR6t
keepqueuedtkids((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyR+�s2
	

cCsJytj|dt�}Wn*tjk
rE}tdd||�dSX|S(NtlockR!serror opening list: %s
%s(RRRtMMListErrorRtNone(RR5RBR3((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyR9�scCs@tdd|�t�}tjd|�td|j��dS(NR!sUncaught runner exception: %stfile(RRt	tracebackt	print_exctgetvalue(Rtexcts((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyR(�s	cCstj|j�dS(s�Clean up upon exit from the main processing loop.

        Called when the Runner's main loop is stopped, this should perform
        any necessary resource deallocation.  Its return value is irrelevant.
        N(RR-R	(R((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyR�scCs
t�dS(s�Dispose of a single message destined for a mailing list.

        Called for each message that the Runner is responsible for, this is
        the primary overridable method for processing each message.
        Subclasses, must provide implementation for this method.

        mlist is the MailList instance this message is destined for.

        msg is the Message object representing the message.

        msgdata is a dictionary of message metadata.
        N(tNotImplementedError(RRBR1R2((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyR?�s
cCsdS(s*Do some processing `every once in a while'.

        Called every once in a while both from the Runner's main loop, and
        from the Runner's hash slice processing loop.  You can do whatever
        special periodic processing you want here, and the return value is
        irrelevant.
        N((R((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyR�scCs-|s|jdkrdStj|j�dS(s+Sleep for a little while.

        filecnt is the number of messages in the queue the last time through.
        Sub-runners can decide to continue to do work, or sleep for a while
        based on this value.  By default, we only snooze if there was nothing
        to do last time around.
        iN(t	SLEEPTIMEttimetsleep(RR((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyRscCs|jS(snReturn a true value if the individual file processing loop should
        exit before it's finished processing each message in the current slice
        of hash space.  A false value tells _oneloop() to continue processing
        until the current snapshot of hash space is exhausted.

        You could, for example, implement a throttling algorithm here.
        (R(R((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyR.sN(Rt
__module__RIR
RtQRUNNER_SLEEP_TIMERQRRRR RR+R9R(RR?RRR.(((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyR,s						A	.						
	((t__doc__RRRKt	cStringIORtMailmanRRRRRtMailman.Logging.SyslogRtMailman.Queue.SwitchboardRtemail.ErrorstemailRRt	NameErrorR(((sb/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Queue/Runner.pyt<module>s"



Zerion Mini Shell 1.0