comparison src/plugins/plugin_misc_maildir.py @ 445:1c1d1a4994c4

plugin maildir: replaced forgotten setPrivate by PersistentBinaryDict.force
author Goffi <goffi@goffi.org>
date Sun, 04 Dec 2011 00:03:15 +0100
parents 866dbb0d7d87
children 6cd04adddaea
comparison
equal deleted inserted replaced
444:d67cae85c2f9 445:1c1d1a4994c4
159 ret = box_data[message_id][0] 159 ret = box_data[message_id][0]
160 else: 160 else:
161 box_data['cur_idx']+=1 161 box_data['cur_idx']+=1
162 box_data[message_id]=[box_data['cur_idx'],[]] 162 box_data[message_id]=[box_data['cur_idx'],[]]
163 ret = box_data[message_id] 163 ret = box_data[message_id]
164 self.host.memory.setPrivate('MAILDIR_data',self.data) 164 self.data[profile].force(boxname)
165 return ret 165 return ret
166 166
167 def getNextUid(self, boxname, profile): 167 def getNextUid(self, boxname, profile):
168 """Return next unique integer that will generated 168 """Return next unique integer that will generated
169 This is mainly needed for the IMAP protocol 169 This is mainly needed for the IMAP protocol
225 assert(type(flags)==list) 225 assert(type(flags)==list)
226 flags=[flag.upper() for flag in flags] #we store every flag UPPERCASE 226 flags=[flag.upper() for flag in flags] #we store every flag UPPERCASE
227 if not box_data.has_key(mess_id): 227 if not box_data.has_key(mess_id):
228 raise MailboxException("Trying to set flags for an unexisting message") 228 raise MailboxException("Trying to set flags for an unexisting message")
229 box_data[mess_id][1]=flags 229 box_data[mess_id][1]=flags
230 self.host.memory.setPrivate('MAILDIR_data',self.data) 230 self.data[profile].force(boxname)
231 231
232 def getMessageIdsWithFlag(self, boxname, flag, profile): 232 def getMessageIdsWithFlag(self, boxname, flag, profile):
233 """Return ids of messages where a flag is set 233 """Return ids of messages where a flag is set
234 @param boxname: name of the box where the message is 234 @param boxname: name of the box where the message is
235 @param flag: flag to check 235 @param flag: flag to check
250 @param boxname: name of the box where the message is 250 @param boxname: name of the box where the message is
251 """ 251 """
252 box_data = self.__getBoxData(boxname, profile) 252 box_data = self.__getBoxData(boxname, profile)
253 for mess_id in self.getMessageIdsWithFlag(boxname,"\\Deleted", profile): 253 for mess_id in self.getMessageIdsWithFlag(boxname,"\\Deleted", profile):
254 del(box_data[mess_id]) 254 del(box_data[mess_id])
255 self.host.memory.setPrivate('MAILDIR_data',self.data) 255 self.data[profile].force(boxname)
256 256
257 def cleanTable(self, boxname, existant_id, profile): 257 def cleanTable(self, boxname, existant_id, profile):
258 """Remove mails which no longuer exist from the table 258 """Remove mails which no longuer exist from the table
259 @param boxname: name of the box to clean 259 @param boxname: name of the box to clean
260 @param existant_id: list of id which actually exist""" 260 @param existant_id: list of id which actually exist"""