(filenames, process, relroot)
| 553 | |
| 554 | |
| 555 | def _iter_filenames(filenames, process, relroot): |
| 556 | if process is None: |
| 557 | yield from fsutil.process_filenames(filenames, relroot=relroot) |
| 558 | return |
| 559 | |
| 560 | onempty = Exception('no filenames provided') |
| 561 | items = process(filenames, relroot=relroot) |
| 562 | items, peeked = iterutil.peek_and_iter(items) |
| 563 | if not items: |
| 564 | raise onempty |
| 565 | if isinstance(peeked, str): |
| 566 | if relroot and relroot is not fsutil.USE_CWD: |
| 567 | relroot = os.path.abspath(relroot) |
| 568 | check = (lambda: True) |
| 569 | for filename, ismany in iterutil.iter_many(items, onempty): |
| 570 | relfile = fsutil.format_filename(filename, relroot, fixroot=False) |
| 571 | yield filename, relfile, check, ismany |
| 572 | elif len(peeked) == 4: |
| 573 | yield from items |
| 574 | else: |
| 575 | raise NotImplementedError |
| 576 | |
| 577 | |
| 578 | def track_progress_compact(items, *, groups=5, **mark_kwargs): |
no test coverage detected
searching dependent graphs…