Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory
(fnames)
| 7825 | |
| 7826 | |
| 7827 | def _FilterExcludedFiles(fnames): |
| 7828 | """Filters out files listed in the --exclude command line switch. File paths |
| 7829 | in the switch are evaluated relative to the current working directory |
| 7830 | """ |
| 7831 | exclude_paths = [os.path.abspath(f) for f in _excludes] |
| 7832 | # because globbing does not work recursively, exclude all subpath of all excluded entries |
| 7833 | return [ |
| 7834 | f |
| 7835 | for f in fnames |
| 7836 | if not any(e for e in exclude_paths if _IsParentOrSame(e, os.path.abspath(f))) |
| 7837 | ] |
| 7838 | |
| 7839 | |
| 7840 | def _IsParentOrSame(parent, child): |
no test coverage detected