Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory
(fnames)
| 7976 | |
| 7977 | |
| 7978 | def _FilterExcludedFiles(fnames): |
| 7979 | """Filters out files listed in the --exclude command line switch. File paths |
| 7980 | in the switch are evaluated relative to the current working directory |
| 7981 | """ |
| 7982 | exclude_paths = [os.path.abspath(f) for f in _excludes] |
| 7983 | # because globbing does not work recursively, exclude all subpath of all excluded entries |
| 7984 | return [ |
| 7985 | f |
| 7986 | for f in fnames |
| 7987 | if not any(e for e in exclude_paths if _IsParentOrSame(e, os.path.abspath(f))) |
| 7988 | ] |
| 7989 | |
| 7990 | |
| 7991 | def _IsParentOrSame(parent, child): |
no test coverage detected
searching dependent graphs…