MCPcopy Index your code
hub / github.com/python/cpython / _iter_filenames

Function _iter_filenames

Tools/c-analyzer/c_common/scriptutil.py:555–575  ·  view source on GitHub ↗
(filenames, process, relroot)

Source from the content-addressed store, hash-verified

553
554
555def _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
578def track_progress_compact(items, *, groups=5, **mark_kwargs):

Callers 2

filter_filenamesFunction · 0.85
main_for_filenamesFunction · 0.85

Calls 2

processFunction · 0.85
abspathMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…