From 8a377455ea62e09d199aa6dc32bfca2b2a80ab90 Mon Sep 17 00:00:00 2001 From: Vladyslav Hroshev Date: Wed, 2 Apr 2025 21:37:52 +0300 Subject: [PATCH] Check for results in concurrent tasks, remove stop_after_first_installed_color flag --- scripts/install/theme_installer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/install/theme_installer.py b/scripts/install/theme_installer.py index 0e6ae90..4f53669 100644 --- a/scripts/install/theme_installer.py +++ b/scripts/install/theme_installer.py @@ -14,7 +14,6 @@ class ThemeInstaller(ABC): def __init__(self, args: argparse.Namespace, colors: ColorsDefiner): self.args = args self.colors = colors - self.stop_after_first_installed_color = False self._define_theme() @abstractmethod @@ -84,9 +83,6 @@ class ThemeInstaller(ABC): sat = values.get('s', args.sat) colors_to_install.append((hue, color, sat)) - if self.stop_after_first_installed_color: - break - if not colors_to_install: return False self._run_concurrent_installation(colors_to_install) @@ -96,4 +92,6 @@ class ThemeInstaller(ABC): with concurrent.futures.ThreadPoolExecutor() as executor: futures = [executor.submit(self._install_theme, hue, color, sat) for hue, color, sat in colors_to_install] - concurrent.futures.wait(futures) \ No newline at end of file + + for future in concurrent.futures.as_completed(futures): + future.result() \ No newline at end of file