Mercurial > piecrust2
diff piecrust/commands/builtin/baking.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 | 84e2bc2d16cb |
children | f0fc2a9d3191 |
line wrap: on
line diff
--- a/piecrust/commands/builtin/baking.py Tue Feb 03 08:20:30 2015 -0800 +++ b/piecrust/commands/builtin/baking.py Tue Feb 03 08:21:43 2015 -0800 @@ -10,7 +10,9 @@ from piecrust.commands.base import ChefCommand from piecrust.processing.base import ProcessorPipeline from piecrust.processing.records import ( - ProcessorPipelineRecord, FLAG_OVERRIDEN) + ProcessorPipelineRecord, + FLAG_PREPARED, FLAG_PROCESSED, FLAG_OVERRIDEN, + FLAG_BYPASSED_STRUCTURED_PROCESSING) logger = logging.getLogger(__name__) @@ -161,9 +163,15 @@ if pattern: if not fnmatch.fnmatch(entry.rel_input, pattern): continue - flags = '' + flags = [] + if entry.flags & FLAG_PREPARED: + flags.append('prepared') + if entry.flags & FLAG_PROCESSED: + flags.append('processed') if entry.flags & FLAG_OVERRIDEN: - flags += 'overriden' + flags.append('overriden') + if entry.flags & FLAG_BYPASSED_STRUCTURED_PROCESSING: + flags.append('external') logger.info(" - ") logger.info(" path: %s" % entry.rel_input) logger.info(" out paths: %s" % entry.rel_outputs) @@ -176,7 +184,7 @@ def format_proc_tree(tree, margin='', level=0): name, children = tree - res = '%s%s%s' % (margin if level > 0 else '', level * ' ', name) + res = '%s%s+ %s\n' % (margin if level > 0 else '', level * ' ', name) if children: for c in children: res += format_proc_tree(c, margin, level + 1)