diff piecrust/processing/records.py @ 221:f82262f59600

bake: Fix processing record bugs and error logging for external processes. Fix problems with processing records not being collapsed correctly. Make it possible to capture external processes' `stderr` output.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 03 Feb 2015 08:21:43 -0800
parents c5ada46b281a
children c4b3a7fd2f87
line wrap: on
line diff
--- a/piecrust/processing/records.py	Tue Feb 03 08:20:30 2015 -0800
+++ b/piecrust/processing/records.py	Tue Feb 03 08:21:43 2015 -0800
@@ -33,9 +33,10 @@
 
 
 FLAG_NONE = 0
-FLAG_PROCESSED = 2**0
-FLAG_OVERRIDEN = 2**1
-FLAG_BYPASSED_STRUCTURED_PROCESSING = 2**2
+FLAG_PREPARED = 2**0
+FLAG_PROCESSED = 2**1
+FLAG_OVERRIDEN = 2**2
+FLAG_BYPASSED_STRUCTURED_PROCESSING = 2**3
 
 
 class ProcessorPipelineRecordEntry(object):
@@ -53,8 +54,13 @@
         return os.path.join(self.base_dir, self.rel_input)
 
     @property
+    def was_prepared(self):
+        return bool(self.flags & FLAG_PREPARED)
+
+    @property
     def was_processed(self):
-        return bool(self.flags & FLAG_PROCESSED)
+        return (self.was_prepared and
+                (bool(self.flags & FLAG_PROCESSED) or len(self.errors) > 0))
 
     @property
     def was_processed_successfully(self):