comparison piecrust/commands/builtin/baking.py @ 872:3004ab31bb46

showrecord: Don't show records that don't match the given filters.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 13 Jun 2017 22:30:45 -0700
parents 8d25f76fce98
children 93ea115027fc
comparison
equal deleted inserted replaced
871:504ddb370df8 872:3004ab31bb46
207 207
208 for rec in records.records: 208 for rec in records.records:
209 if ctx.args.fails and rec.success: 209 if ctx.args.fails and rec.success:
210 continue 210 continue
211 211
212 logger.info("Record: %s" % rec.name) 212 ppname = rec.name[rec.name.index('@') + 1:]
213 logger.info("Status: %s" % ('SUCCESS' if rec.success 213 if ppname not in pipelines:
214 else 'FAILURE')) 214 continue
215
216 entries_to_show = []
217
215 for e in rec.getEntries(): 218 for e in rec.getEntries():
216 if ctx.args.fails and e.success: 219 if ctx.args.fails and e.success:
217 continue 220 continue
218 if in_pattern and not fnmatch.fnmatch(e.item_spec, in_pattern): 221 if in_pattern and not fnmatch.fnmatch(e.item_spec, in_pattern):
219 continue 222 continue
220 if out_pattern and not any( 223 if out_pattern and not any(
221 [fnmatch.fnmatch(op, out_pattern) 224 [fnmatch.fnmatch(op, out_pattern)
222 for op in e.getAllOutputPaths()]): 225 for op in e.getAllOutputPaths()]):
223 continue 226 continue
224 _print_record_entry(e) 227 entries_to_show.append(e)
225 228
226 logger.info("") 229 if entries_to_show:
230 logger.info("Record: %s" % rec.name)
231 logger.info("Status: %s" % ('SUCCESS' if rec.success
232 else 'FAILURE'))
233 for e in entries_to_show:
234 _print_record_entry(e)
235 logger.info("")
227 236
228 stats = records.stats 237 stats = records.stats
229 if ctx.args.show_stats: 238 if ctx.args.show_stats:
230 _show_stats(stats) 239 _show_stats(stats)
231 240