From 59b712ecbc7bd5cbdd55a0c2a38efddfd8b837b1 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Mon, 18 Jul 2016 18:40:17 +0200 Subject: [PATCH] remove dead code: the description of the passes is never used Some minor style fixes. Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/Base.py | 14 +++++++------- offlineimap/folder/Gmail.py | 9 ++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py index e467f23..8cc22df 100644 --- a/offlineimap/folder/Base.py +++ b/offlineimap/folder/Base.py @@ -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,8 +1094,8 @@ 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, self.accountname)) + self.ui.error(e, exc_info()[2], "Syncing folder %s [acc: %s]"% + (self, self.accountname)) raise # Raise unknown Exceptions so we can fix them. def __eq__(self, other): diff --git a/offlineimap/folder/Gmail.py b/offlineimap/folder/Gmail.py index bc39f8e..31eaeb3 100644 --- a/offlineimap/folder/Gmail.py +++ b/offlineimap/folder/Gmail.py @@ -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,10 +56,10 @@ 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', '') + ignorelabels = self.repository.account.getconf('ignorelabels', '') self.ignorelabels = set([l for l in re.split(r'\s*,\s*', ignorelabels) if len(l)])