/head: changeset 50
Fixed save() such that it will be atomic. If the program crashes while writing, it is guaranteed to have either a complete copy of the old or the new data.
This commit is contained in:
parent
05d8f27955
commit
132a38bfce
@ -1,3 +1,22 @@
|
|||||||
|
2002-06-24 09:58 jgoerzen
|
||||||
|
|
||||||
|
* debian/changelog, offlineimap/version.py: Preparation for 1.0.2
|
||||||
|
|
||||||
|
2002-06-24 09:54 jgoerzen
|
||||||
|
|
||||||
|
* offlineimap/folder/LocalStatus.py: Fixed save() such that it will
|
||||||
|
be atomic. If the program crashes while writing, it is guaranteed
|
||||||
|
to have either a complete copy of the old or the new data.
|
||||||
|
|
||||||
|
2002-06-22 21:37 jgoerzen
|
||||||
|
|
||||||
|
* TODO: Added.
|
||||||
|
|
||||||
|
2002-06-21 22:04 jgoerzen
|
||||||
|
|
||||||
|
* ChangeLog, debian/changelog, offlineimap/version.py: Final prep
|
||||||
|
for 1.0.1
|
||||||
|
|
||||||
2002-06-21 22:03 jgoerzen
|
2002-06-21 22:03 jgoerzen
|
||||||
|
|
||||||
* offlineimap.py, offlineimap/folder/IMAP.py: Fixed a bug with
|
* offlineimap.py, offlineimap/folder/IMAP.py: Fixed a bug with
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
offlineimap (1.0.2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Made sure that LocalStatus does writing atomically. If the program
|
||||||
|
is interrupted during save(), there will always be a complete copy of
|
||||||
|
either the old or the new data.
|
||||||
|
|
||||||
|
-- John Goerzen <jgoerzen@complete.org> Mon, 24 Jun 2002 09:57:28 -0500
|
||||||
|
|
||||||
offlineimap (1.0.1) unstable; urgency=low
|
offlineimap (1.0.1) unstable; urgency=low
|
||||||
|
|
||||||
* Fixed a bug with writing messages to some IMAP servers. Turns
|
* Fixed a bug with writing messages to some IMAP servers. Turns
|
||||||
|
@ -61,7 +61,7 @@ class LocalStatusFolder(BaseFolder):
|
|||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
file = open(self.filename, "wt")
|
file = open(self.filename + ".tmp", "wt")
|
||||||
file.write(magicline + "\n")
|
file.write(magicline + "\n")
|
||||||
for msg in self.messagelist.values():
|
for msg in self.messagelist.values():
|
||||||
flags = msg['flags']
|
flags = msg['flags']
|
||||||
@ -69,6 +69,7 @@ class LocalStatusFolder(BaseFolder):
|
|||||||
flags = ''.join(flags)
|
flags = ''.join(flags)
|
||||||
file.write("%s:%s\n" % (msg['uid'], flags))
|
file.write("%s:%s\n" % (msg['uid'], flags))
|
||||||
file.close()
|
file.close()
|
||||||
|
os.rename(self.filename + ".tmp", self.filename)
|
||||||
|
|
||||||
def getmessagelist(self):
|
def getmessagelist(self):
|
||||||
return self.messagelist
|
return self.messagelist
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
productname = 'OfflineIMAP'
|
productname = 'OfflineIMAP'
|
||||||
versionstr = "1.0.1"
|
versionstr = "1.0.2"
|
||||||
|
|
||||||
versionlist = versionstr.split(".")
|
versionlist = versionstr.split(".")
|
||||||
major = versionlist[0]
|
major = versionlist[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user