Skip to content

Commit

Permalink
cleaned leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
niradar committed Jun 19, 2024
1 parent a5860ed commit dab1994
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions duplicate_files_in_folders/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,8 @@ def is_allowed_path(self, path: str | Path) -> bool:
if not self.allowed_dirs:
return True # If allowed_dirs is an empty set, all paths are allowed

# resolve all path parents
path_parents = [p.resolve() for p in path.parents]

logger.debug(f"path: {path}, path_parents: {path_parents}, allowed_dirs: {self.allowed_dirs}")

# True if the path is in any of the allowed directories
return any(path == allowed_dir or allowed_dir in path_parents for allowed_dir in self.allowed_dirs)
return any(path == allowed_dir or allowed_dir in path.parents for allowed_dir in self.allowed_dirs)

def move_file(self, src: str, dst: str) -> bool:
"""
Expand Down

0 comments on commit dab1994

Please sign in to comment.