Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory
(fnames)
| 6846 | return filtered |
| 6847 | |
| 6848 | def _FilterExcludedFiles(fnames): |
| 6849 | """Filters out files listed in the --exclude command line switch. File paths |
| 6850 | in the switch are evaluated relative to the current working directory |
| 6851 | """ |
| 6852 | exclude_paths = [os.path.abspath(f) for f in _excludes] |
| 6853 | # because globbing does not work recursively, exclude all subpath of all excluded entries |
| 6854 | return [f for f in fnames |
| 6855 | if not any(e for e in exclude_paths |
| 6856 | if _IsParentOrSame(e, os.path.abspath(f)))] |
| 6857 | |
| 6858 | def _IsParentOrSame(parent, child): |
| 6859 | """Return true if child is subdirectory of parent. |
no test coverage detected