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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyo
�
��Vc@sfddlmZddlmZddlmZddlmZddlZ	defd��YZ
dS(	i����(texc_info(tLock(tOfflineImapErrori(t
IMAPFolderNtMappedIMAPFoldercBs�eZdZd�Zd�Zd�Zdd�Zd�Zddd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(sIMAP class to map between Folder() instances where both side assign a uid

    This Folder is used on the local side, while the remote side should
    be an IMAPFolder.

    Instance variables (self.):
      r2l: dict mapping message uids: self.r2l[remoteuid]=localuid
      l2r: dict mapping message uids: self.r2l[localuid]=remoteuid
      #TODO: what is the difference, how are they used?
      diskr2l: dict mapping message uids: self.r2l[remoteuid]=localuid
      diskl2r: dict mapping message uids: self.r2l[localuid]=remoteuidcOsMtj|||�t�|_|j�\|_|_t||�|_dS(N(Rt__init__Rtmaplockt	_loadmapstdiskr2ltdiskl2rt_mb(tselftargstkwargs((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyR%s
cCs"tjj|jj�|j��S(N(tostpathtjoint
repositoryt	getmapdirtgetfolderbasename(R((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyt_getmapfilename,sc
Cs|jj�z�|j�}tjj|�s8iifSt|d�}i}i}x�|j�}t|�srPny|j	�}Wn4t
k
r�td||f�dt
�d�nX|jd�\}}t|�}t|�}	|||	<|	||<qV||fSWd|jj�XdS(Ntrts*Corrupt line '%s' in UID mapping file '%s'it:(RtacquireRRRtexiststopentreadlinetlentstript
ValueErrort	ExceptiontNoneRtsplittlongtrelease(
Rtmapfilenametfiletr2ltl2rtlinetstr1tstr2tloctrem((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyR0s0


!

icCs�|j�}|r"|jj�nzlt|dd�}x4|jj�D]#\}}|jd||f�qHW|j�tj	|d|�Wd|r�|jj
�nXdS(Ns.tmptwts%d:%d
(RRRRR	t	iteritemstwritetcloseRtrenameR"(RtdolockR#R$tkeytvalue((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyt	_savemapsKs
cCsnyg|D]}||^q
SWnHtk
ri}tdj|jd|�tjj�dt�d�nXdS(NsrCould not find UID for msg '{0}' (f:'{1}'. This is usually a bad thing and should be reported on the mailing list.ii(tKeyErrorRtformatRtERRORtMESSAGERR(Rtmappingtitemstxte((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyt_uidlistWs	cCs4|jjd|d|�|jj�}|jj|_|jj�z�xG|jj�D]6}||krW|j|}|j|=|j|=qWqWW|j	dd�d}|jj
�|_|jj
�|_xP|j�D]B}||jkr�|}|d8}||j|<||j|<q�q�WWd|jj
�XdS(Ntmin_datetmin_uidR1ii����i(R
tcachemessagelisttgetmessagelisttmessagelistRRR	tkeysRR4tcopyR%R&R"(RR>R?treallisttluidtruidtnextneg((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyR@as*




cCs|jj�dS(N(R
tdropmessagelistcache(R((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRI�scCs
||jkS(s0Checks if the (remote) UID exists in this Folder(R%(RRG((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyt	uidexists�scCs
|jj�S(skGets a list of (remote) UIDs.
        You may have to call cachemessagelist() before calling this function!(R%RC(R((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pytgetmessageuidlist�scCs
t|j�S(syGets the number of messages in this folder.
        You may have to call cachemessagelist() before calling this function!(RR%(R((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pytgetmessagecount�scCs�i}|jj�}|jj�zxxm|j�D]_\}}y|j|}Wntk
req2nX|j�}|j|d|d<|||<q2W|SWd|jj�XdS(s�Gets the current message list. This function's implementation
        is quite expensive for the mapped UID case.  You must call
        cachemessagelist() before calling this function!tuidN(	R
RARRR:R&R5RDR"(Rtretvalt	localhashR2R3((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRA�s

cCs|jj|j|�S(s-Returns the content of the specified message.(R
t
getmessageR%(RRM((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRP�scCs�|jjd|||�|dkr)|S||jkrL|j||�|S|jjd|||�}|dkr�td|��n|jj�zH||j|<||j	|<||j
|<||j|<|jdd�Wd|jj�X|S(s�Writes a new message, with the specified uid.

        The UIDMaps class will not return a newly assigned uid, as it
        internally maps different uids between IMAP servers. So a
        successful savemessage() invocation will return the same uid it
        has been invoked with. As it maps between 2 IMAP servers which
        means the source message must already have an uid, it requires a
        positive uid to be passed in. Passing in a message with a
        negative uid will do nothing and return the negative uid.

        If the uid is > 0, the backend should set the uid to this, if it can.
        If it cannot set the uid to that, it will save it anyway.
        It will return the uid assigned in any case.

        See folder/Base for details. Note that savemessage() does not
        check against dryrun settings, so you need to ensure that
        savemessage is never called in a dryrun mode.
        timapii����is3Backend could not find uid for message, returned %sR1N(
tuitsavemessageR%tsavemessageflagsR
RRRR	RR&R4R"(RRMtcontenttflagstrtimetnewluid((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRS�s&





cCs|jj|j|�S(N(R
tgetmessageflagsR%(RRM((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRY�scCsdS(N(R(RRM((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pytgetmessagetime�scCs|jj|j||�dS(s�Note that this function does not check against dryrun settings,
        so you need to ensure that it is never called in a
        dryrun mode.N(R
RTR%(RRMRV((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRT�scCs|jj|j||�dS(N(R
taddmessageflagsR%(RRMRV((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyR[�scCs&|jj|j|j|�|�dS(N(R
taddmessagesflagsR=R%(RtuidlistRV((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyR\�scCs�||jkr+td|tjj��n||kr;dS|jj�z�|j|}||j|<|j|=||j|<|dkr�||j|<n|dkr�|j|=n|dkr�||j|<n|j	dd�Wd|jj
�XdS(s�Change the message from existing ruid to new_ruid

        :param new_uid: The old remote UID will be changed to a new
            UID. The UIDMaps case handles this efficiently by simply
            changing the mappings file.s$Cannot change unknown Maildir UID %sNiR1(R%RR7R8RRR&R	RR4R"(RRGtnew_ruidRF((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pytchange_message_uids&





cCs�|jj�z~d}xX|D]P}|j|}|j|=|j|=|dkr|j|=|j|=d}qqW|r�|jdd�nWd|jj�XdS(NiiR1(RRR%R&RR	R4R"(RR]t	needssaveRGRF((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyt_mapped_deletes







cCs|jj|j||�dS(N(R
tdeletemessageflagsR%(RRMRV((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRb-scCs&|jj|j|j|�|�dS(N(R
tdeletemessagesflagsR=R%(RR]RV((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRc1scCs+|jj|j|�|j|g�dS(N(R
t
deletemessageR%Ra(RRM((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRd6scCs0|jj|j|j|��|j|�dS(N(R
tdeletemessagesR=R%Ra(RR]((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRe;sN(t__name__t
__module__t__doc__RRRR4R=RR@RIRJRKRLRARPRSRYRZRTR[R\R_RaRbRcRdRe(((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyRs2				
 							.										(tsysRt	threadingRtofflineimapRtIMAPRtos.pathRR(((s>/usr/lib/python2.7/site-packages/offlineimap/folder/UIDMaps.pyt<module>s


Spamworldpro Mini