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/ui/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/offlineimap/ui/UIBase.pyc
�
��Vc@sddlZddlZddlZddlZddlZddlZddlZyddlmZWn!ek
r�ddl	mZnXddl
mZddlm
Z
ddlZidd6dd6d	d
6dd6adad
�Zd�Zdefd��YZdS(i����N(tQueue(tdeque(tOfflineImapErrors'Other offlineimap related sync messagestsIMAP protocol debuggingtimapsMaildir repository debuggingtmaildirsThreading debuggingtthreadcCs
|adS(s0Set the global ui object to be used for logging.N(tglobalui(tnewui((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytsetglobalui'scCstS(sReturn the current ui object.(R(((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytgetglobalui-stUIBasecBseZejd�Zd�Zd�Zd�Zd�Zd�Z	dd�Z
d7d7d�Zd	�Z
d
�Zd7d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd7d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d �Z$d!�Z%d"�Z&d#�Z'd$�Z(d%�Z)d&�Z*d'�Z+d(�Z,d)�Z-d*�Z.d+�Z/d,�Z0d-�Z1d.�Z2d/�Z3d0�Z4d1�Z5dd7d7d2�Z6d3�Z7d4�Z8d5�Z9d6�Z:RS(8cCs�||_|jddt�|_g|_i|_d|_i|_i|_d|_
t�|_t|_
tjd�|_|jj|�|j�|_dS(Ntgeneralsdry-runitOfflineImap(tconfigtgetdefaultbooleantFalsetdryrunt	debuglistt
debugmessagestdebugmsglentthreadaccountstacct_startimestNonetlogfileRt	exc_queuetuidval_problemtloggingt	getLoggertloggertsetLeveltsetup_consolehandlert_log_con_handler(tselfRtloglevel((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt__init__5s								cCs[tjtj�}tjd�|_|j|j�|jj|�|jj	t
j�|S(s�Backend specific console handler.

        Sets up things and adds them to self.logger.
        :returns: The logging.Handler() for console outputs%(message)s(Rt
StreamHandlertsyststdoutt	Formattert	formattertsetFormatterRt
addHandlertinfotofflineimaptbanner(R!tch((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyRNscCsHtjjd�}tjd�|_|j|j�|jj|�dS(s Backend specific syslog handler.s/dev/logs%(message)sN(Rthandlerst
SysLogHandlerR'R(R)RR*(R!R.((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytsetup_sysloghandler_scCs�tj|d�}tjdd�}|j|�|jj|�djgtjdd!D]}t	|�^qX�}dt
j|tjdjtj
�f}tjd	tjtd
|d
d
�}|j|�d
S(s'Create file handler which logs to file.tats&%(asctime)s %(levelname)s: %(message)ss%Y-%m-%d %H:%M:%St.iis?OfflineImap %s starting...
  Python: %s Platform: %s
  Args: %st R
N(RtFileHandlerR'R)RR*tjoinR%tversion_infotstrR,t__version__tplatformtargvt	LogRecordtINFOt__file__Rtemit(R!Rtfhtfile_formattertxtp_vertmsgtrecord((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt
setlogfilejs		
2cCs|j|�dS(sDisplay a message.N(R+(R!RD((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt_msg|scCs|jj|�dS(sDisplay a message.N(RR+(R!RD((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyR+�sicCs|jj|�dS(N(Rtwarning(R!RDtminor((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytwarn�scCs�|r#|jjd||f�n|jjd|�|}|jsOd}n|jj|||f�|r�|jjtj|��ndS(s�Log a message at severity level ERROR.

        Log Exception 'exc' to error log, possibly prepended by a preceding
        error "msg", detailing at what point the error occurred.

        In debug mode, we also output the full traceback that occurred
        if one has been passed in via sys.info()[2].

        Also save the Exception to a stack that can be output at the end
        of the sync run when offlineiamp exits. It is recommended to
        always pass in exceptions if possible, so we can give the user
        the best debugging info.
        
        We are always pushing tracebacks to the exception queue to
        make them to be output at the end of the run to allow users
        pass sensible diagnostics to the developers or to solve
        problems by themselves.

        One example of such a call might be:

           ui.error(exc, sys.exc_info()[2], msg="While syncing Folder %s in "
               "repo %s")
        sERROR: %s
  %ss	ERROR: %sN(RterrorRRRtputt	tracebackt	format_tb(R!texct
exc_tracebackRDtinstant_traceback((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyRK�s		cCs{tj�}||jkrJ|jdd|j�|j|�|f�n |jdd|j�|f�||j|<dS(sARegister current thread as being associated with an account name.Rs0Register thread '%s' (previously '%s', now '%s')s'Register new thread '%s' (account '%s')N(t	threadingt
currentThreadRtdebugtgetNametgetthreadaccount(R!taccountt
cur_thread((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytregisterthread�s	cCs:||jkr|j|=n|jdd|j��dS(s=Unregister a thread as being associated with an account name.RsUnregister thread '%s'N(RRTRU(R!tthr((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytunregisterthread�s
cCs9|dkrtj�}n||jkr5|j|SdS(sxGet Account() for a thread (current if None)

        If no account has been registered with this thread, return 'None'.N(RRRRSR(R!RZ((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyRV�s
cCs�tj�}||jkr.t�|j|<n|j|jd||f�t|j|�|jkr||j|j�n||jkr�|j	j
d||f�ndS(Ns%s: %ss[%s]: %s(RRRSRRtappendtlenRtpopleftRRRT(R!t	debugtypeRDRX((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyRT�scCsO|tkr>||jkrK|jj|�|j|�qKn
|j|�dS(N(t
debugtypesRR\t	debuggingtinvaliddebug(R!R_((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt	add_debug�s
cCs"|jjd|t|f�dS(NsNow debugging for %s: %s(RRTR`(R!R_((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyRa�scCs|jd|�dS(NsInvalid debug type: %s(RJ(R!R_((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyRb�scCs,|jjjd�d}tjdd|�S(s\Return the type of a repository or Folder as string.

        (IMAP, Gmail, Maildir, etc...)R3i����s(Folder|Repository)R(t	__class__t__name__tsplittretsub(R!tobjectt
prelimname((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytgetnicename�scCstS(s�Returns true if this UI object is usable in the current
        environment.  For instance, an X GUI would return true if it's
        being run in X with a valid DISPLAY setting, and false otherwise.(tTrue(R!((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytisusable�scCstd��dS(Ns=Prompting for a password is not supported in this UI backend.(tNotImplementedError(R!taccountnameRterrmsg((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytgetpassscCs9djg|D]%}d|j|�|j�f^q
�S(Ns, s%s[%s](R6Rktgetname(R!tfolder_listRB((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt
folderlists	cCsU|jjdd�r.|jjdd�r.dS|jd||j|�|f�dS(NRsignore-readonlys�Attempted to synchronize message %d to folder %s[%s], but that folder is read-only.  The message will not be copied to that folder.(Rt
has_optiont
getbooleanRJRk(R!t
destfoldertuidtcontenttflags((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt
msgtoreadonlys
	cCs[|jjdd�r.|jjdd�r.dS|jdt|�|j|�|f�dS(NRsignore-readonlys�Attempted to modify flags for messages %s in folder %s[%s], but that folder is read-only.  No flags have been modified for that message.(RRuRvRJR8Rk(R!RwtuidlistRz((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytflagstoreadonlys
	cCs[|jjdd�r.|jjdd�r.dS|jdt|�|j|�|f�dS(NRsignore-readonlys�Attempted to modify labels for messages %s in folder %s[%s], but that folder is read-only.  No labels have been modified for that message.(RRuRvRJR8Rk(R!RwR|tlabels((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytlabelstoreadonlys
	cCs[|jjdd�r.|jjdd�r.dS|jdt|�|j|�|f�dS(NRsignore-readonlys~Attempted to delete messages %s in folder %s[%s], but that folder is read-only.  No messages have been deleted in that folder.(RRuRvRJR8Rk(R!RwR|((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytdeletereadonly's	cCsdS(s�Called when the UI starts.  Must be called before any other UI
        call except isusable().  Displays the copyright banner.  This is
        where the UI should do its setup -- TK, for instance, would
        create the application window here.N((R!((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytinit_banner2scCsx|jjtj�sdSd}|r+|nd}|rAd|nd}|r`d||f}n|jjd|�dS(s!Log 'Establishing connection to'.NRs%ss	 to %s:%ssEstablishing connection%s(RtisEnabledForRR=R+(R!thostnametportt
displaystr((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt
connecting9scCs+tj�|j|<|jjd|�dS(s=Output that we start syncing an account (and start counting).s*** Processing account %sN(ttimeRRR+(R!RW((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytacctDscCsJtj�|j|}|j|=|jjd||d|df�dS(s;Output that we finished syncing an account (in which time).s$*** Finished account '%s' in %d:%02di<N(R�RRR+(R!RWtsec((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytacctdoneJs
cCs6|jjtj�r2|jdd||f�ndS(s"Log 'Copying folder structure...'.Rs&Copying folder structure from %s to %sN(RR�RtDEBUGRT(R!tsrc_repotdst_repo((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytsyncfoldersRscCs5|jrdnd}|jdj|||��dS(s Called when a folder is created.s	[DRYRUN] Rs{0}Creating folder {1}[{2}]N(RR+tformat(R!trepot
foldernametprefix((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt
makefolderZscCs3|jjd||j|�|j|�f�dS(s/Called when a folder sync operation is started.sSyncing %s: %s -> %sN(RR+Rk(R!tsrcrepost	srcfoldert	destreposRw((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt
syncingfolderascCs|jjd|�dS(s/Called when a folder sync operation is started.sSkipping %s (not changed)N(RR+(R!tfolder((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytskippingfolderhscCs?t|_|jjd||j�|j�|j�f�dS(Ns~UID validity problem for folder %s (repo %s) (saved %d; got %d); skipping it. Please see FAQ and manual on how to handle this.(RlRRRHt
getrepositorytget_saveduidvaliditytget_uidvalidity(R!R�((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytvalidityproblemls	cCs'|jjd|j|�|f�dS(NsLoading message list for %s[%s](RRTRk(R!treposR�((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytloadmessagelisttscCs*|jjd|j|�||f�dS(Ns+Message list for %s[%s] loaded: %d messages(RRTRk(R!R�R�tcount((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytmessagelistloadedyscCs6|jjd|j|�||j|�|f�dS(Ns!Syncing messages %s[%s] -> %s[%s](RRTRk(R!tsrR�tdrt	dstfolder((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytsyncingmessagesscCs0|jjd||||j||jf�dS(s/Output a log line stating which message we copys&Copy message %s (%d of %d) %s:%s -> %sN(RR+t
repository(R!Rxtnumtnum_to_copytsrcRw((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytcopyingmessage�scCsY|j|�}|jrdnd}|jdj|t|�tjj|�|��dS(Ns	[DRYRUN] Rs%{0}Deleting {1} messages ({2}) in {3}(RtRR+R�R]R,timaputiltuid_sequence(R!R|tdestlisttdsR�((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytdeletingmessages�s
cCs0|jjddj|�t|�|f�dS(Ns#Adding flag %s to %d messages on %ss, (RR+R6R](R!R|Rztdest((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytaddingflags�scCs0|jjddj|�t|�|f�dS(Ns'Deleting flag %s from %d messages on %ss, (RR+R6R](R!R|RzR�((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt
deletingflags�scCs'|jjd|t|�|f�dS(Ns$Adding label %s to %d messages on %s(RR+R](R!R|tlabelR�((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytaddinglabels�scCs'|jjd|t|�|f�dS(Ns(Deleting label %s from %d messages on %s(RR+R](R!R|R�R�((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytdeletinglabels�scCs0|jjd||||dj|�f�dS(Ns1Setting labels to message %d on %s (%d of %d): %ss, (RR+R6(R!RxR�t
num_to_setR~R�((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt
settinglabels�scCsA|r)|jjdt|�|f�n|jjd|�dS(Ns&Collecting data from %d messages on %ss#Collecting data from messages on %s(RR+R](R!R|tsource((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytcollectingdata�scCs�d}|jd||j|j|�f�z8t|d�r
|jd|j�|j�|j�f�y|jj	�}Wn$t
k
r�}|jd|�q
Xd|jkr�|jd�n|jdt|j
��|jdt|j��|jj|�n|d	krc|jd
d�}|rB|jd|�n|jdd�}|rn|jd
|�n|jdd�}|r�|jd|�n|j�}g|D]!}	|	j|	j�|	jf^q�}
g}xi|
D]a\}}}
|
r�dnd}||kr(|jd||f�q�|jd|||f�q�W|jddj|��nWd|r}|jj�nXdS(sBConnect to repository and output useful information for debugging.s%s repository '%s': type '%s'tgethostsHost: %s Port: %s SSL: %ssFailed to connect. Reason %stIDsServer supports ID extension.sServer welcome string: %ssServer capabilities: %s
tStatustfolderfiltersfolderfilter= %s
tfolderincludessfolderincludes= %s
t	nametranssnametrans= %s
Rs (disabled)s%s%ss
%s -> %s%ssFolderlist:
 %s
s
 N(RRGtnameRkthasattrR�tgetporttgetsslt
imapservertacquireconnectionRtcapabilitiesR8twelcometreleaseconnectiontgetconft
getfolderstgetvisiblenamet	sync_thisR\R6tclose(R!R�ttypetconnteR�R�R�tfolderstftfoldernamesR�tvisiblenameR�tsyncstr((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytserverdiagnostics�sP+!cCs'|j|d||t|�f�dS(s-Output a log line stating that we save a msg.s Write mail '%s:%d' with flags %sN(RTtrepr(R!R_RxRzR�((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytsavemessage�scCsc||jkrOdt|j|�|j�f}|dj|j|�7}nd|j�}|S(Ns:
Last %d debug messages logged for %s prior to exception:
s
s&
No debug messages were logged for %s.(RR]RUR6(R!Rtmessage((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytgetThreadDebugLog�s 
cCs ||jkr|j|=ndS(N(R(R!R((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytdelThreadDebugLog�scCs4d|j�|jf}|d|j|�7}|S(Ns)Thread '%s' terminated with exception:
%ss
(RUtexit_stacktraceR�(R!RR�((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytgetThreadExceptionString�scCs4|j|j|��|j|�|jd�dS(s{Called when a thread has terminated with an exception.
        The argument is the ExitNotifyThread that has so terminated.idN(RJR�R�t	terminate(R!R((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytthreadException�s
cCs>|jj�s4|jd�|dkr4d}q4nx�|jj�s�|jj�\}}}|r~|jd||f�n|jd|�|r7|jddjtj|���q7q7W|r�|r�|jd||f�n|r�|jd	|�n|jr-|jd
�|dkr-d}q-ntj	|�dS(
s$Called to terminate the application.s*ERROR: Exceptions occurred during the run!iisERROR: %s
  %ss	ERROR: %ss
Traceback:
%sRsERROR: %s

%s
s%s
s7At least one folder skipped due to UID validity problemiN(
RtemptyRJtgetR6RMRNRR%texit(R!t
exitstatust
errortitleterrormsgRDRORP((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyR�s*
	
cCs|j|�|j|�dS(sRCalled when a thread has exited normally.

        Many UIs will just ignore this.N(R�R[(R!R((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytthreadExiteds
cCs3|jr"|jdj|��n
|j|�dS(Ns[DRYRUN] {0}(RR+R�(R!RD((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytcallhook)s	cCset}xH|dkrP|rP|j�r1t}q	|jd|�}|d8}q	W|jdd�|S(s@This function does not actually output anything, but handles
        the overall sleep, dealing with updates as necessary.  It will,
        however, call sleeping() which DOES output something.

        :returns: 0/False if timeout expired, 1/2/True if there is a
                  request to cancel the timer.
        ii
(Rtget_abort_eventRltsleeping(R!t	sleepsecsRWt
abortsleep((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pytsleep1s		cCsS|dkrO|d||dkr?|jjd|d�ntj|�ndS(sbSleep for sleepsecs, display remainingsecs to go.

        Does nothing if sleepsecs <= 0.
        Display a message on the screen if we pass a full minute.

        This implementation in UIBase does not support this, but some
        implementations return 0 for successful sleep and 1 for an
        'abort', ie a request to sync immediately.
        ii<sNext refresh in %.1f minutesgN@(RRTR�R�(R!R�t
remainingsecs((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyR�DsN(;Ret
__module__RR=R#RR1RFRGR+RJRRKRYR[RVRTRcRaRbRkRmRqRtR{R}RR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyR4sl					&																																								3		
				
		(Rtlogging.handlersRgR�R%RMRRRtImportErrortqueuetcollectionsRtofflineimap.errorRR,R`RRR	R
RiR(((s9/usr/lib/python2.7/site-packages/offlineimap/ui/UIBase.pyt<module>s*


		

Spamworldpro Mini