docker-offlineimap/offlineimap/repository
Sebastian Spaeth 792243c78f Improve repository/Maildir.getfolder() to use cached objects
Previously, getfolder() would always construct new MaildirFolder()
objects, independent of whether the folder exists or not. Improve the
function to:

1) Scan and cache the folders if not already done
2) Return the same cached object if we ask for the same foldername twice
3) Reduce a tiny bit of code duplication

This is important because we handle stuff like folderfilter in the
scandir function and if we discard the scanned dir and create a new
object on folderget(), we will lose the folderfilter information.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-09-19 13:24:42 +02:00
..
__init__.py Create an abstract Repository class 2011-03-03 18:19:42 +01:00
Base.py Set accountname in BaseFolder, and don't pass it in initialization 2011-09-16 12:54:12 +02:00
Gmail.py Replaced tabs with spaces to unify python sources 2011-08-16 22:33:19 +02:00
IMAP.py Debug log/error proof the creation of new IMAP folders 2011-09-19 11:36:03 +02:00
LocalStatus.py Don't pass in 'root' as para to LocalStatusFolders 2011-09-16 12:54:12 +02:00
Maildir.py Improve repository/Maildir.getfolder() to use cached objects 2011-09-19 13:24:42 +02:00