/head: changeset 26
Updated.
This commit is contained in:
parent
eb634de2cd
commit
6e5817986b
@ -105,6 +105,10 @@ class BaseFolder:
|
||||
def deletemessage(self, uid):
|
||||
raise NotImplementedException
|
||||
|
||||
def deletemessages(self, uidlist):
|
||||
for uid in uidlist:
|
||||
self.deletemessage(uid)
|
||||
|
||||
def syncmessagesto(self, dest, applyto = None):
|
||||
"""Syncs messages in this folder to the destination.
|
||||
If applyto is specified, it should be a list of folders (don't forget
|
||||
|
@ -88,6 +88,16 @@ class IMAPFolder(BaseFolder):
|
||||
self.messagelist[uid] = {'uid': uid, 'flags': flags}
|
||||
return uid
|
||||
|
||||
|
||||
def savemessageflags(self, uid, flags):
|
||||
assert(self.imapobj.select(self.getfullname())[0] == 'OK')
|
||||
result = self.imapobj.uid('store', '%d' % uid, 'FLAGS',
|
||||
imaputil.flagsmaildir2imap(flags))[1][0]
|
||||
flags = imaputil.flags2hash(imaputil.imapsplit(result)[1]){'FLAGS'}
|
||||
self.messagelist[uid]['flags'] = imaputil.flagsimap2maildir(flags)
|
||||
|
||||
def deletemessage(self, uid):
|
||||
self.addmessagesflags(uid, ['T'])
|
||||
assert(self.imapobj.select(self.getfullname())[0] == 'OK')
|
||||
assert(self.imapobj.expunge()[0] == 'OK')
|
||||
|
||||
|
||||
|
@ -100,5 +100,5 @@ def flagsmaildir2imap(list):
|
||||
if flagmap.has_key(mdflag):
|
||||
retval.append(flagmap[mdflag])
|
||||
retval.sort()
|
||||
return retval
|
||||
return '(' + ' '.join(retval) + ')'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user