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