From 0305e90287fa5f1356d2fb7f5e73f40a6cb10605 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:05:11 +1100 Subject: [PATCH] chore: ruff --- invokeai/backend/model_manager/search.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/invokeai/backend/model_manager/search.py b/invokeai/backend/model_manager/search.py index b1ee0c22de..7e89c394b1 100644 --- a/invokeai/backend/model_manager/search.py +++ b/invokeai/backend/model_manager/search.py @@ -118,7 +118,7 @@ class ModelSearch(ModelSearchBase): """ models_found: Set[Path] = Field(default_factory=set) - config: InvokeAIAppConfig = InvokeAIAppConfig.get_config() + config: InvokeAIAppConfig = InvokeAIAppConfig.get_config() def search_started(self) -> None: self.models_found = set() @@ -147,9 +147,11 @@ class ModelSearch(ModelSearchBase): def _walk_directory(self, path: Union[Path, str], max_depth: int = 20) -> None: absolute_path = Path(path) - if len(absolute_path.parts) - len(self._directory.parts) > max_depth \ - or not absolute_path.exists() \ - or absolute_path.parent in self.models_found: + if ( + len(absolute_path.parts) - len(self._directory.parts) > max_depth + or not absolute_path.exists() + or absolute_path.parent in self.models_found + ): return entries = os.scandir(absolute_path.as_posix()) entries = [entry for entry in entries if not entry.name.startswith(".")]