Prettify and use new uidexists() helper function
Make the folder classes use uidexists() more. Add some code documentation while going through. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:

committed by
Nicolas Sebrecht

parent
0318c6ad34
commit
f4081985dc
@ -295,8 +295,16 @@ class MaildirFolder(BaseFolder):
|
||||
assert final_dir != tmpdir
|
||||
|
||||
def deletemessage(self, uid):
|
||||
if not uid in self.messagelist:
|
||||
"""Unlinks a message file from the Maildir.
|
||||
|
||||
:param uid: UID of a mail message
|
||||
:type uid: String
|
||||
:return: Nothing, or an Exception if UID but no corresponding file
|
||||
found.
|
||||
"""
|
||||
if not self.uidexists(uid):
|
||||
return
|
||||
|
||||
filename = self.messagelist[uid]['filename']
|
||||
try:
|
||||
os.unlink(filename)
|
||||
|
Reference in New Issue
Block a user