diff piecrust/processing/records.py @ 133:9e4c2e68a129

Optimize server for files that already exist. * Only try to find new assets if no previously existing asset or page could be used. * Tidy up a bit the API for passing and returning bake/process records. * Put the process record in its place.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 18 Nov 2014 21:32:04 -0800
parents 133845647083
children 308d5180bf81
line wrap: on
line diff
--- a/piecrust/processing/records.py	Tue Nov 18 21:29:12 2014 -0800
+++ b/piecrust/processing/records.py	Tue Nov 18 21:32:04 2014 -0800
@@ -21,6 +21,15 @@
                     return entry
         return None
 
+    def replaceEntry(self, new_entry):
+        for e in self.entries:
+            if (e.base_dir == new_entry.base_dir and
+                    e.rel_input == new_entry.rel_input):
+                e.flags = new_entry.flags
+                e.rel_outputs = list(new_entry.rel_outputs)
+                e.errors = list(new_entry.errors)
+                break
+
 
 FLAG_NONE = 0
 FLAG_PROCESSED = 2**0