/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:
parent
a3f422cf98
commit
225e9c61d6
@ -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
|
||||
|
||||
|
@ -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 = {}
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user