(datacmd, filenames, known=None, *,
_analyze=_analyze,
formats=FORMATS,
extracolumns=None,
relroot=fsutil.USE_CWD,
track_progress=None,
**kwargs
)
| 433 | |
| 434 | |
| 435 | def cmd_data(datacmd, filenames, known=None, *, |
| 436 | _analyze=_analyze, |
| 437 | formats=FORMATS, |
| 438 | extracolumns=None, |
| 439 | relroot=fsutil.USE_CWD, |
| 440 | track_progress=None, |
| 441 | **kwargs |
| 442 | ): |
| 443 | kwargs.pop('verbosity', None) |
| 444 | usestdout = kwargs.pop('show', None) |
| 445 | if datacmd == 'show': |
| 446 | do_fmt = formats['summary'] |
| 447 | if isinstance(known, str): |
| 448 | known, _ = _datafiles.get_known(known, extracolumns, relroot) |
| 449 | for line in do_fmt(known): |
| 450 | print(line) |
| 451 | elif datacmd == 'dump': |
| 452 | filenames, relroot = fsutil.fix_filenames(filenames, relroot=relroot) |
| 453 | if track_progress: |
| 454 | filenames = track_progress(filenames) |
| 455 | analyzed = _analyze(filenames, **kwargs) |
| 456 | analyzed.fix_filenames(relroot, normalize=False) |
| 457 | if known is None or usestdout: |
| 458 | outfile = io.StringIO() |
| 459 | _datafiles.write_known(analyzed, outfile, extracolumns, |
| 460 | relroot=relroot) |
| 461 | print(outfile.getvalue()) |
| 462 | else: |
| 463 | _datafiles.write_known(analyzed, known, extracolumns, |
| 464 | relroot=relroot) |
| 465 | elif datacmd == 'check': |
| 466 | raise NotImplementedError(datacmd) |
| 467 | else: |
| 468 | raise ValueError(f'unsupported data command {datacmd!r}') |
| 469 | |
| 470 | |
| 471 | COMMANDS = { |
nothing calls this directly
no test coverage detected
searching dependent graphs…