Remove trailing whitespaces.

This commit is contained in:
Emmanuel Gil Peyrot 2013-01-18 17:55:34 +01:00
commit 27b3592e16

View file

@ -57,7 +57,7 @@ class MaildirError(Exception):
pass
class MaildirBox():
def __init__(self, host):
info(_("Plugin Maildir initialization"))
self.host = host
@ -184,14 +184,14 @@ class MaildirBox():
if idx>box_data['cur_idx']:
return None
return idx
def getMaxUid(self, boxname, profile):
"""Give the max existing uid
@param boxname: name of the box where the message is
@return: uid"""
box_data = self.__getBoxData(boxname, profile)
return box_data['cur_idx']
def getIdFromUid(self, boxname, message_uid, profile):
"""Return the message unique id from it's integer UID
@param boxname: name of the box where the message is
@ -251,9 +251,9 @@ class MaildirBox():
"""
box_data = self.__getBoxData(boxname, profile)
for mess_id in self.getMessageIdsWithFlag(boxname,"\\Deleted", profile):
del(box_data[mess_id])
del(box_data[mess_id])
self.data[profile].force(boxname)
def cleanTable(self, boxname, existant_id, profile):
"""Remove mails which no longuer exist from the table
@param boxname: name of the box to clean
@ -265,7 +265,7 @@ class MaildirBox():
to_remove.append(key)
for key in to_remove:
del box_data[key]
def addObserver(self, callback, profile, boxname, signal="NEW_MESSAGE"):
"""Add an observer for maildir box changes
@param callback: method to call when the the box is updated
@ -327,7 +327,7 @@ class MailboxUser:
elif e.name == "subject":
mail['Subject'] = e.children[0].encode('utf-8')
return mail.as_string()
def __init__(self, _maildir, name, observer=None, profile="@NONE@"):
"""@param _maildir: the main MaildirBox instance
@param name: name of the mailbox
@ -350,7 +350,7 @@ class MailboxUser:
self.mailbox = maildir.MaildirMailbox(mailbox_path)
self.observer=observer
self.__uid_table_update()
if observer:
debug("adding observer for %s (%s)" % (name,profile))
self.maildir.addObserver(observer, profile, name, "NEW_MESSAGE")
@ -362,7 +362,7 @@ class MailboxUser:
existant_id.append(self.getId(mess_idx))
self.getUid(mess_idx)
self.maildir.cleanTable(self.name, existant_id, profile=self.profile)
def __del__(self):
if observer:
@ -417,7 +417,7 @@ class MailboxUser:
if self.getUid(mess_idx) == mess_uid:
return mess_idx
raise IndexError
def getIdxFromId(self, mess_id):
"""Return the message index from the unique index
@param mess_id: message unique index as given by MaildirMailbox
@ -426,7 +426,7 @@ class MailboxUser:
if self.mailbox.getUidl(mess_idx) == mess_id:
return mess_idx
raise IndexError
def getMessage(self, mess_idx):
"""Return the full message
@param mess_idx: message index"""
@ -443,7 +443,7 @@ class MailboxUser:
@return: list of strings"""
id = self.getId(mess_idx)
return self.maildir.getFlags(self.name, id, profile=self.profile)
def getFlagsUid(self, mess_uid):
"""Return the flags of the message
@param mess_uid: message unique identifier
@ -487,4 +487,4 @@ class MailboxUser:
"""Delete everything in the .Trash dir"""
import shutils
pdb.set_trace()