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

View File

@ -19,8 +19,7 @@ import re
import six import six
from sys import exc_info from sys import exc_info
from offlineimap import imaputil, OfflineImapError from offlineimap import imaputil, imaplibutil, OfflineImapError
from offlineimap import imaplibutil
import offlineimap.accounts import offlineimap.accounts
from .IMAP import IMAPFolder from .IMAP import IMAPFolder
@ -46,7 +45,7 @@ class GmailFolder(IMAPFolder):
super(GmailFolder, self).__init__(imapserver, name, repository) super(GmailFolder, self).__init__(imapserver, name, repository)
self.trash_folder = repository.gettrashfolder(name) self.trash_folder = repository.gettrashfolder(name)
# Gmail will really delete messages upon EXPUNGE in these folders # 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 # The header under which labels are stored
self.labelsheader = self.repository.account.getconf('labelsheader', 'X-Keywords') self.labelsheader = self.repository.account.getconf('labelsheader', 'X-Keywords')
@ -57,10 +56,10 @@ class GmailFolder(IMAPFolder):
# if synclabels is enabled, add a 4th pass to sync labels # if synclabels is enabled, add a 4th pass to sync labels
if self.synclabels: if self.synclabels:
self.imap_query.insert(0, 'X-GM-LABELS') 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 # Labels to be left alone
ignorelabels = self.repository.account.getconf('ignorelabels', '') ignorelabels = self.repository.account.getconf('ignorelabels', '')
self.ignorelabels = set([l for l in re.split(r'\s*,\s*', ignorelabels) if len(l)]) self.ignorelabels = set([l for l in re.split(r'\s*,\s*', ignorelabels) if len(l)])