Mercurial > piecrust2
comparison piecrust/commands/builtin/baking.py @ 754:78de21447e4e
showrecord: Fix some crashes and incorrect information.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 25 Jun 2016 16:59:43 -0700 |
parents | ab5c6a8ae90a |
children | 87df68be4cc8 |
comparison
equal
deleted
inserted
replaced
753:9a92e2804562 | 754:78de21447e4e |
---|---|
13 from piecrust.commands.base import ChefCommand | 13 from piecrust.commands.base import ChefCommand |
14 from piecrust.environment import ExecutionStats | 14 from piecrust.environment import ExecutionStats |
15 from piecrust.processing.pipeline import ProcessorPipeline | 15 from piecrust.processing.pipeline import ProcessorPipeline |
16 from piecrust.processing.records import ( | 16 from piecrust.processing.records import ( |
17 ProcessorPipelineRecord, | 17 ProcessorPipelineRecord, |
18 FLAG_PREPARED, FLAG_PROCESSED, | 18 FLAG_PREPARED, FLAG_PROCESSED, FLAG_BYPASSED_STRUCTURED_PROCESSING, |
19 FLAG_BYPASSED_STRUCTURED_PROCESSING) | 19 FLAG_COLLAPSED_FROM_LAST_RUN) |
20 from piecrust.rendering import ( | 20 from piecrust.rendering import ( |
21 PASS_FORMATTING, PASS_RENDERING) | 21 PASS_FORMATTING, PASS_RENDERING) |
22 | 22 |
23 | 23 |
24 logger = logging.getLogger(__name__) | 24 logger = logging.getLogger(__name__) |
242 record = BakeRecord.load(record_cache.getCachePath(record_name)) | 242 record = BakeRecord.load(record_cache.getCachePath(record_name)) |
243 return record | 243 return record |
244 | 244 |
245 def _showBakeRecord(self, ctx, record_name, pattern, out_pattern): | 245 def _showBakeRecord(self, ctx, record_name, pattern, out_pattern): |
246 record = self._getBakeRecord(ctx, record_name) | 246 record = self._getBakeRecord(ctx, record_name) |
247 if record is None: | |
248 return | |
247 | 249 |
248 logging.info("Bake record for: %s" % record.out_dir) | 250 logging.info("Bake record for: %s" % record.out_dir) |
249 logging.info("From: %s" % record_name) | 251 logging.info("From: %s" % record_name) |
250 logging.info("Last baked: %s" % | 252 logging.info("Last baked: %s" % |
251 datetime.datetime.fromtimestamp(record.bake_time)) | 253 datetime.datetime.fromtimestamp(record.bake_time)) |
256 logging.info("Entries:") | 258 logging.info("Entries:") |
257 for entry in record.entries: | 259 for entry in record.entries: |
258 if pattern and not fnmatch.fnmatch(entry.path, pattern): | 260 if pattern and not fnmatch.fnmatch(entry.path, pattern): |
259 continue | 261 continue |
260 if out_pattern and not ( | 262 if out_pattern and not ( |
261 any([o for o in entry.out_paths | 263 any([o for o in entry.all_out_paths |
262 if fnmatch.fnmatch(o, out_pattern)])): | 264 if fnmatch.fnmatch(o, out_pattern)])): |
263 continue | 265 continue |
264 | 266 |
265 flags = _get_flag_descriptions( | 267 flags = _get_flag_descriptions( |
266 entry.flags, | 268 entry.flags, |
367 flags = _get_flag_descriptions( | 369 flags = _get_flag_descriptions( |
368 entry.flags, | 370 entry.flags, |
369 { | 371 { |
370 FLAG_PREPARED: 'prepared', | 372 FLAG_PREPARED: 'prepared', |
371 FLAG_PROCESSED: 'processed', | 373 FLAG_PROCESSED: 'processed', |
372 FLAG_BYPASSED_STRUCTURED_PROCESSING: 'external'}) | 374 FLAG_BYPASSED_STRUCTURED_PROCESSING: 'external', |
375 FLAG_COLLAPSED_FROM_LAST_RUN: 'from last run'}) | |
373 | 376 |
374 logger.info(" - ") | 377 logger.info(" - ") |
375 logger.info(" path: %s" % rel_path) | 378 logger.info(" path: %s" % rel_path) |
376 logger.info(" out paths: %s" % entry.rel_outputs) | 379 logger.info(" out paths: %s" % entry.rel_outputs) |
377 logger.info(" flags: %s" % _join(flags)) | 380 logger.info(" flags: %s" % _join(flags)) |