/head: changeset 26

Updated.
This commit is contained in:
jgoerzen 2002-06-21 02:55:06 +01:00
parent eb634de2cd
commit 6e5817986b
3 changed files with 17 additions and 3 deletions

View File

@ -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

View File

@ -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')

View File

@ -100,5 +100,5 @@ def flagsmaildir2imap(list):
if flagmap.has_key(mdflag):
retval.append(flagmap[mdflag])
retval.sort()
return retval
return '(' + ' '.join(retval) + ')'