remove dead code: the description of the passes is never used

Some minor style fixes.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2016-07-18 18:40:17 +02:00
parent 2f3c01f0be
commit 59b712ecbc
2 changed files with 11 additions and 12 deletions

View File

@ -83,9 +83,9 @@ class BaseFolder(object):
# Passes for syncmessagesto.
self.syncmessagesto_passes = [
('copying messages' , self.__syncmessagesto_copy),
('deleting messages' , self.__syncmessagesto_delete),
('syncing flags' , self.__syncmessagesto_flags)
self.__syncmessagesto_copy,
self.__syncmessagesto_delete,
self.__syncmessagesto_flags,
]
def getname(self):
@ -1039,7 +1039,7 @@ class BaseFolder(object):
dstfolder.addmessagesflags(uids, set(flag))
statusfolder.addmessagesflags(uids, set(flag))
for flag,uids in delflaglist.items():
for flag, uids in delflaglist.items():
self.ui.deletingflags(uids, flag, dstfolder)
if self.repository.account.dryrun:
continue # Don't actually remove in a dryrun.
@ -1081,7 +1081,7 @@ class BaseFolder(object):
:param statusfolder: LocalStatus instance to sync against.
"""
for (passdesc, action) in self.syncmessagesto_passes:
for action in self.syncmessagesto_passes:
# Bail out on CTRL-C or SIGTERM.
if offlineimap.accounts.Account.abort_NOW_signal.is_set():
break
@ -1094,7 +1094,7 @@ class BaseFolder(object):
raise
self.ui.error(e, exc_info()[2])
except Exception as e:
self.ui.error(e, exc_info()[2], "Syncing folder %s [acc: %s]" %\
self.ui.error(e, exc_info()[2], "Syncing folder %s [acc: %s]"%
(self, self.accountname))
raise # Raise unknown Exceptions so we can fix them.

View File

@ -19,8 +19,7 @@ import re
import six
from sys import exc_info
from offlineimap import imaputil, OfflineImapError
from offlineimap import imaplibutil
from offlineimap import imaputil, imaplibutil, OfflineImapError
import offlineimap.accounts
from .IMAP import IMAPFolder
@ -46,7 +45,7 @@ class GmailFolder(IMAPFolder):
super(GmailFolder, self).__init__(imapserver, name, repository)
self.trash_folder = repository.gettrashfolder(name)
# Gmail will really delete messages upon EXPUNGE in these folders
self.real_delete_folders = [ self.trash_folder, repository.getspamfolder() ]
self.real_delete_folders = [self.trash_folder, repository.getspamfolder()]
# The header under which labels are stored
self.labelsheader = self.repository.account.getconf('labelsheader', 'X-Keywords')
@ -57,7 +56,7 @@ class GmailFolder(IMAPFolder):
# if synclabels is enabled, add a 4th pass to sync labels
if self.synclabels:
self.imap_query.insert(0, 'X-GM-LABELS')
self.syncmessagesto_passes.append(('syncing labels', self.syncmessagesto_labels))
self.syncmessagesto_passes.append(self.syncmessagesto_labels)
# Labels to be left alone
ignorelabels = self.repository.account.getconf('ignorelabels', '')