def check_excluded(
self, paths: Iterable[str], start_path: str) -> Set[str]:
"""Get the paths that have been excluded by each client.
Args:
paths: The paths to check.
start_path: The path of the directory to match globbing patterns
against.
Returns:
The subset of input paths that have been excluded by each client.
"""
pattern_files = []
for entry in os.scandir(self._exclude_dir):
pattern_files.append(ProfileExcludeFile(entry.path))
rm_files = set()
for path in paths:
for pattern_file in pattern_files:
if path not in pattern_file.all_matches(start_path):
break
else:
rm_files.add(path)
return rm_files
评论列表
文章目录