Skip to content

Commit

Permalink
Refactor: made method "private": print_trashinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
andreafrancia committed Nov 9, 2023
1 parent 2b1c1a5 commit 547eb42
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions trashcli/list/list_trash_action.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
from __future__ import print_function

import os

from typing import NamedTuple, List
from typing import List
from typing import NamedTuple

from trashcli.lib.dir_reader import DirReader
from trashcli.lib.path_of_backup_copy import path_of_backup_copy
from trashcli.lib.trash_dir_reader import TrashDirReader
from trashcli.list.extractors import DeletionDateExtractor, SizeExtractor
from trashcli.list.extractors import DeletionDateExtractor
from trashcli.list.extractors import SizeExtractor
from trashcli.parse_trashinfo.parse_path import parse_path
from trashcli.parse_trashinfo.parser_error import ParseError
from trashcli.trash_dirs_scanner import trash_dir_found, \
trash_dir_skipped_because_parent_not_sticky, \
from trashcli.trash_dirs_scanner import trash_dir_found
from trashcli.trash_dirs_scanner import \
trash_dir_skipped_because_parent_is_symlink
from trashcli.trash_dirs_scanner import \
trash_dir_skipped_because_parent_not_sticky


class ListTrashArgs(
Expand Down Expand Up @@ -94,8 +97,8 @@ def list_all_trash(self,
path, volume = event_args
trash_dir = TrashDirReader(self.dir_reader)
for trash_info in trash_dir.list_trashinfo(path):
for msg in self.print_trashinfo(volume, trash_info,
extractor, show_files):
for msg in self._print_trashinfo(volume, trash_info,
extractor, show_files):
yield msg
elif event == trash_dir_skipped_because_parent_not_sticky:
path, = event_args
Expand All @@ -108,11 +111,11 @@ def list_all_trash(self,
self.top_trashdir_skipped_because_parent_is_symlink(path))
yield msg

def print_trashinfo(self,
volume,
trashinfo_path,
extractor,
show_files):
def _print_trashinfo(self,
volume,
trashinfo_path,
extractor,
show_files):
try:
contents = self.content_reader.contents_of(trashinfo_path)
except IOError as e:
Expand Down

0 comments on commit 547eb42

Please sign in to comment.