docker-offlineimap/offlineimap/folder
Sebastian Spaeth 3ce514e92b Simplify MappedIMAPFolder, fixing bugs
Previously, we instanciated an MappedImapFolder, and would cleverly (too
cleverly?) invoke methods on it casting it to an IMAPFolder by calling
methods such as: self._mb.cachemessages(self) where self._MB is the class
IMAPFolder and self and instance of MappedImapFolder. If
e.g. cachemessages() invokes a method uidexists() which exists for
MappedImapFolder, but not directly in IMAPFolder, I am not sure if
Python would at some point attempt to use the method of the wrong class.
Also, this leads to some twisted thinking as our class would in same
cases act as an IMAPFolder and in some cases as an MappedImapFOlder and
it is not always clear if we mean REMOTE UID or LOCAL UID.

This commit simplifies the class, by a)doing away with the complex Mixin
construct and directly inheriting from IMAPFOlder (so we get all the
IMAPFOlder methods that we can inherit). We instantiate self._mb as a
new instance of IMAPFolder which represents the local IMAP using local
UIDs, separating the MappedIMAPFolder construct logically from the
IMAPFolder somewhat.

In the long run, I would like to remove self._mb completely and simply
override any method that needs overriding, but let us take small and
understandable baby steps here.

Reported-and-tested-by: Vincent Beffara <vbeffara@gmail.com>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2011-06-25 17:03:22 +02:00
..
__init__.py Add Gmail IMAP special support. 2008-01-03 04:56:55 +01:00
Base.py refactoring: simplify the semaphorewait logic 2011-05-12 18:30:39 +02:00
Gmail.py Remove some unneeded imports 2011-03-14 19:51:52 +01:00
IMAP.py Throw OfflineImapError when we try to request an inexistant message 2011-06-15 22:17:04 +02:00
LocalStatus.py Use self.doautosave rather than self.dofsync 2011-05-07 13:29:11 +02:00
LocalStatusSQLite.py cleanup: remove uneeded imports 2011-05-09 22:42:15 +02:00
Maildir.py Simplify Maildir message saving 2011-06-13 16:29:00 +02:00
UIDMaps.py Simplify MappedIMAPFolder, fixing bugs 2011-06-25 17:03:22 +02:00