Properly manipulate contents of messagelist for folder
Create initializer function that puts default values to all fields of message list item. Fix all code that directly assigns some hash to the elements of messagelist: for direct assignments only initializer is now permitted, all other modification are done in-place. Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:
@ -56,6 +56,12 @@ class GmailMaildirFolder(MaildirFolder):
|
||||
return True
|
||||
return False #Nope, nothing changed
|
||||
|
||||
|
||||
# Interface from BaseFolder
|
||||
def msglist_item_initializer(self, uid):
|
||||
return {'flags': set(), 'labels': set(), 'filename': '/no-dir/no-such-file/', 'mtime': 0}
|
||||
|
||||
|
||||
def cachemessagelist(self):
|
||||
if self.messagelist is None:
|
||||
self.messagelist = self._scanfolder()
|
||||
|
Reference in New Issue
Block a user