/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 a change, but not propogate it. New config variable ignore-readonly
can suppress the warnings. This fixes [complete.org #10] and, can suppress the warnings. This fixes [complete.org #10] and,
for Debian, Closes: #154769. 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 -- 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): def getfullname(self):
return self.filename return self.filename
def deletemessagelist(self):
if not self.isnewfolder():
os.unlink(self.filename)
def cachemessagelist(self): def cachemessagelist(self):
if self.isnewfolder(): if self.isnewfolder():
self.messagelist = {} self.messagelist = {}

View File

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