Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
andreafrancia committed Jan 20, 2017
1 parent 1985e77 commit 578bb14
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions trashcli/put.py
Expand Up @@ -317,21 +317,19 @@ def _file_could_be_trashed_in(self,
return volume_of_trash_dir == volume_of_file_to_be_trashed

def _possible_trash_directories_for(self, volume):
def make_trash_dir(path, volume):
return TrashDirectoryForPut(path, volume, self.fs)
trash_dirs = []
def add_home_trash(path, volume):
trash_dir = make_trash_dir(path, volume)
trash_dir = TrashDirectoryForPut(path, volume, self.fs)
trash_dir.path_maker = AbsolutePaths()
checker = all_is_ok_checker
trash_dirs.append((trash_dir, checker))
def add_top_trash_dir(path, volume):
trash_dir = make_trash_dir(path, volume)
trash_dir = TrashDirectoryForPut(path, volume, self.fs)
trash_dir.path_maker = TopDirRelativePaths(volume)
checker = TopTrashDirWriteRules
trash_dirs.append((trash_dir, checker))
def add_alt_top_trash_dir(path, volume):
trash_dir = make_trash_dir(path, volume)
trash_dir = TrashDirectoryForPut(path, volume, self.fs)
trash_dir.path_maker = TopDirRelativePaths(volume)
checker = all_is_ok_checker
trash_dirs.append((trash_dir, checker))
Expand Down

0 comments on commit 578bb14

Please sign in to comment.