equal
deleted
inserted
replaced
24 raise "Journal already exists!" |
24 raise "Journal already exists!" |
25 self.file = open(self.journal, "w") |
25 self.file = open(self.journal, "w") |
26 |
26 |
27 def __del__(self): |
27 def __del__(self): |
28 if self.entries: self.abort() |
28 if self.entries: self.abort() |
29 self.close() |
29 try: os.unlink(self.journal) |
|
30 except: pass |
30 |
31 |
31 def add(self, file, offset): |
32 def add(self, file, offset): |
32 self.entries.append((file, offset)) |
33 self.entries.append((file, offset)) |
33 # add enough data to the journal to do the truncate |
34 # add enough data to the journal to do the truncate |
34 self.file.write("%s\0%d\n" % (file, offset)) |
35 self.file.write("%s\0%d\n" % (file, offset)) |