don't backup by default; helps fixing distcheck
authorThomas Vander Stichele <thomas@apestaart.org>
Sun, 4 Sep 2005 01:14:56 +0000 (01:14 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Sun, 4 Sep 2005 01:14:56 +0000 (01:14 +0000)
Original commit message from CVS:
don't backup by default; helps fixing distcheck

mangle-tmpl.py

index 801b711..2c90f9d 100644 (file)
@@ -66,16 +66,17 @@ class Tmpl:
 
         return "".join(lines)
 
-    def write(self):
+    def write(self, backup=False):
         """
         Write out the template file again, backing up the previous one.
         """
-        target = self.filename + ".mangle.bak"
-        os.rename(self.filename, target)
+        if backup:
+            target = self.filename + ".mangle.bak"
+            os.rename(self.filename, target)
+
         handle = open(self.filename, "w")
         handle.write(self.output())
         handle.close()
-
         
 def main():
     if len(sys.argv) > 1 and sys.argv[1]: