diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py index 7adc3a4..73b8ff1 100644 --- a/offlineimap/accounts.py +++ b/offlineimap/accounts.py @@ -265,8 +265,8 @@ class SyncableAccount(Account): raise self.ui.error(e, exc_info()[2]) except Exception as e: - self.ui.error(e, exc_info()[2], msg = "While attempting to sync" - " account '%s'" % self) + self.ui.error(e, exc_info()[2], msg="While attempting to sync" + " account '%s'"% self) else: # after success sync, reset the looping counter to 3 if self.refreshperiod: diff --git a/offlineimap/init.py b/offlineimap/init.py index f53c9a5..8b20394 100644 --- a/offlineimap/init.py +++ b/offlineimap/init.py @@ -40,6 +40,7 @@ class OfflineImap: oi = OfflineImap() oi.run() """ + def run(self): """Parse the commandline and invoke everything""" # next line also sets self.config and self.ui diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 5b70966..c59b3a8 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -357,9 +357,8 @@ class IMAPRepository(BaseRepository): self.ui.error(e, exc_info()[2], 'Invalid folderinclude:') continue - retval.append(self.getfoldertype()(self.imapserver, - foldername, - self)) + retval.append(self.getfoldertype()( + self.imapserver, foldername, self)) finally: self.imapserver.releaseconnection(imapobj) diff --git a/offlineimap/repository/LocalStatus.py b/offlineimap/repository/LocalStatus.py index 1390347..170145b 100644 --- a/offlineimap/repository/LocalStatus.py +++ b/offlineimap/repository/LocalStatus.py @@ -94,7 +94,8 @@ class LocalStatusRepository(BaseRepository): self.forgetfolders() def getfolder(self, foldername): - """Return the Folder() object for a foldername""" + """Return the Folder() object for a foldername.""" + if foldername in self._folders: return self._folders[foldername] diff --git a/offlineimap/repository/Maildir.py b/offlineimap/repository/Maildir.py index be86b34..58bf664 100644 --- a/offlineimap/repository/Maildir.py +++ b/offlineimap/repository/Maildir.py @@ -170,8 +170,8 @@ class MaildirRepository(BaseRepository): self.debug(" skip this entry (not a directory)") # Not a directory -- not a folder. continue + # extension can be None. if extension: - # extension can be None which fails. foldername = os.path.join(extension, dirname) else: foldername = dirname