diff options
author | Maxim Devaev <[email protected]> | 2023-03-16 04:45:44 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-03-16 04:45:44 +0200 |
commit | 55cbd7fec8e55fc3801860c932392554d11656b7 (patch) | |
tree | 76b379d76f3b8ca0894bdd3292d53c7f104be43d /kvmd/plugins | |
parent | 4d6da37f401ace8788725542c0bf3e55b641c68b (diff) |
refactoring
Diffstat (limited to 'kvmd/plugins')
-rw-r--r-- | kvmd/plugins/msd/otg/storage.py | 8 |
1 files changed, 4 insertions, 4 deletions
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 |