/offlineimap/head: changeset 206

If a given Maildir folder is new, remove the associated local status
cache file, if any. That way, there will not be any chance of
propogating hordes of deletes and adds based on old status data.
This commit is contained in:
jgoerzen 2002-08-08 03:20:36 +01:00
parent a3f422cf98
commit 225e9c61d6
3 changed files with 16 additions and 5 deletions

View File

@ -7,6 +7,9 @@ offlineimap (3.2.2) unstable; urgency=low
a change, but not propogate it. New config variable ignore-readonly
can suppress the warnings. This fixes [complete.org #10] and,
for Debian, Closes: #154769.
* If a given Maildir folder is new, remove the associated local status
cache file, if any. That way, there will not be any chance of
propogating hordes of deletes and adds based on old status data.
-- John Goerzen <jgoerzen@complete.org> Thu, 25 Jul 2002 08:22:25 -0500

View File

@ -47,6 +47,10 @@ class LocalStatusFolder(BaseFolder):
def getfullname(self):
return self.filename
def deletemessagelist(self):
if not self.isnewfolder():
os.unlink(self.filename)
def cachemessagelist(self):
if self.isnewfolder():
self.messagelist = {}

View File

@ -50,17 +50,21 @@ class MaildirFolder(BaseFolder):
return os.path.join(self.getroot(), self.getname())
def getuidvalidity(self):
if hasattr(self, 'uidvalidity'):
return self.uidvalidity
if not os.path.exists(self.uidfilename):
return None
file = open(self.uidfilename, "rt")
retval = long(file.readline().strip())
file.close()
return retval
self.uidvalidity = None
else:
file = open(self.uidfilename, "rt")
self.uidvalidity = long(file.readline().strip())
file.close()
return self.uidvalidity
def saveuidvalidity(self, newval):
file = open(self.uidfilename, "wt")
file.write("%d\n" % newval)
file.close()
self.uidvalidity = newval
def isuidvalidityok(self, remotefolder):
myval = self.getuidvalidity()