40
37
self.realfilename = filename
48
45
self.write = self.f.write
58
49
"""Close the file and move to final name."""
68
53
if sys.platform == 'win32':
77
55
os.rename(self.tmpfilename, self.realfilename)
81
58
"""Discard temporary file without committing changes."""
90
61
os.remove(self.tmpfilename)
94
64
"""Discard the file unless already committed."""