docker-offlineimap/offlineimap/repository
Sebastian Spaeth 1b54b85f20 Reuse LocalStatus() folders rather than recreate instances
If we ask twice for a LocalStatusFolder via getfolder(), we would
get a newly created instance each time. This can lead to problems,
as e.g. write locks protecting files only work within the same Folder
instance. Make it so, that we cache all Folder instances that we have
asked for and hand back the existing one if we ask again for it,
rather than recreate a new instance.

Also, make getfolders() a noop for LocalStatus. We attempted to
derive the foldername from the name of the LocalStatusfile. However,
this is not really possible, as we do file name mangling
(".$" -> "dot", "/" -> ".") and there is no way to get the original folder
name from the LocalStatus file name anyway.

This commit could potentially solve the "file not found" errors, that people
have been seeing with their LocalStatusCache files. If we have 2
instances of a LocalStatusFolder pointing to the same file, our locking
system would not work.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-09-01 01:19:19 +02:00
..
__init__.py Throw OfflineImapErrors rather than weird Exceptions 2012-08-31 20:31:43 +02:00
Base.py Fix cut-off line 2012-08-21 17:00:39 +02:00
Gmail.py Remove Gmail realdelete option 2012-02-04 21:08:44 +01:00
IMAP.py Warn about nonsensical config option 'sep' for IMAP repositories 2012-04-02 23:26:59 +02:00
LocalStatus.py Reuse LocalStatus() folders rather than recreate instances 2012-09-01 01:19:19 +02:00
Maildir.py Implement ui.makefolder and abort repo.makefolder() in dry-run mode 2012-02-17 13:17:03 +01:00