diff piecrust/pipelines/_procrecords.py @ 854:08e02c2a2a1a

core: Keep refactoring, this time to prepare for generator sources. - Make a few APIs simpler. - Content pipelines create their own jobs, so that generator sources can keep aborting in `getContents`, but rely on their pipeline to generate pages for baking.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 04 Jun 2017 23:34:28 -0700
parents f070a4fc033c
children 448710d84121
line wrap: on
line diff
--- a/piecrust/pipelines/_procrecords.py	Sun May 21 00:06:59 2017 -0700
+++ b/piecrust/pipelines/_procrecords.py	Sun Jun 04 23:34:28 2017 -0700
@@ -1,4 +1,5 @@
-from piecrust.pipelines.records import RecordEntry
+from piecrust.pipelines.records import (
+    RecordEntry, get_flag_descriptions)
 
 
 class AssetPipelineRecordEntry(RecordEntry):
@@ -12,6 +13,7 @@
         super().__init__()
         self.flags = self.FLAG_NONE
         self.proc_tree = None
+        self.out_paths = []
 
     @property
     def was_prepared(self):
@@ -33,8 +35,9 @@
 
     def describe(self):
         d = super().describe()
-        d['Flags'] = _get_flag_descriptions(self.flags)
+        d['Flags'] = get_flag_descriptions(self.flags, flag_descriptions)
         d['Processing Tree'] = _format_proc_tree(self.proc_tree, 20 * ' ')
+        d['Outputs'] = list(self.out_paths)
         return d
 
 
@@ -45,16 +48,6 @@
     AssetPipelineRecordEntry.FLAG_COLLAPSED_FROM_LAST_RUN: 'from last run'}
 
 
-def _get_flag_descriptions(flags):
-    res = []
-    for k, v in flag_descriptions.items():
-        if flags & k:
-            res.append(v)
-    if res:
-        return ', '.join(res)
-    return 'none'
-
-
 def _format_proc_tree(tree, margin='', level=0):
     name, children = tree
     res = '%s%s+ %s\n' % (margin if level > 0 else '', level * '  ', name)