Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory
(fnames)
| 6858 | return filtered |
| 6859 | |
| 6860 | def _FilterExcludedFiles(fnames): |
| 6861 | """Filters out files listed in the --exclude command line switch. File paths |
| 6862 | in the switch are evaluated relative to the current working directory |
| 6863 | """ |
| 6864 | exclude_paths = [os.path.abspath(f) for f in _excludes] |
| 6865 | # because globbing does not work recursively, exclude all subpath of all excluded entries |
| 6866 | return [f for f in fnames |
| 6867 | if not any(e for e in exclude_paths |
| 6868 | if _IsParentOrSame(e, os.path.abspath(f)))] |
| 6869 | |
| 6870 | def _IsParentOrSame(parent, child): |
| 6871 | """Return true if child is subdirectory of parent. |
no test coverage detected