From 55cbd7fec8e55fc3801860c932392554d11656b7 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Thu, 16 Mar 2023 04:45:44 +0200 Subject: refactoring --- kvmd/plugins/msd/otg/storage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kvmd/plugins') diff --git a/kvmd/plugins/msd/otg/storage.py b/kvmd/plugins/msd/otg/storage.py index 0bdbbaae..4cca878b 100644 --- a/kvmd/plugins/msd/otg/storage.py +++ b/kvmd/plugins/msd/otg/storage.py @@ -133,20 +133,20 @@ class Storage: def get_watchable_paths(self) -> list[str]: paths: list[str] = [] for (root_path, dirs, _) in os.walk(self.__path): - dirs[:] = list(self.__filter(dirs)) + dirs[:] = list(self.__filtered(dirs)) paths.append(root_path) return paths def get_images(self) -> dict[str, Image]: images: dict[str, Image] = {} for (root_path, dirs, files) in os.walk(self.__path): - dirs[:] = list(self.__filter(dirs)) - for file in self.__filter(files): + dirs[:] = list(self.__filtered(dirs)) + for file in self.__filtered(files): name = os.path.relpath(os.path.join(root_path, file), self.__path) images[name] = self.get_image_by_name(name) return images - def __filter(self, items: list[str]) -> Generator[str, None, None]: + def __filtered(self, items: list[str]) -> Generator[str, None, None]: for item in sorted(map(str.strip, items)): if not item.startswith(".") and item != "lost+found": yield item -- cgit v1.2.3