From fd1285e215c67c3cdcc8cc5e9076ddcb2bc0ed7c Mon Sep 17 00:00:00 2001 From: l0drex Date: Sun, 14 Apr 2024 17:07:50 +0200 Subject: [PATCH] Fix vscode plugin breaking if previously installed --- yin_yang/plugins/vscode.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yin_yang/plugins/vscode.py b/yin_yang/plugins/vscode.py index a0c6549..01b0e56 100755 --- a/yin_yang/plugins/vscode.py +++ b/yin_yang/plugins/vscode.py @@ -86,8 +86,6 @@ def update_config(self, config: dict, theme: str): @property def available_themes(self) -> dict: themes_dict = {} - if not self.available: - return themes_dict for path in filter(isdir, extension_paths): with os.scandir(path) as entries: @@ -100,9 +98,12 @@ def available_themes(self) -> dict: for theme_name in get_theme_name(f'{d.path}/package.json'): themes_dict[theme_name] = theme_name - assert themes_dict != {}, 'No themes found' return themes_dict + @property + def available(self) -> bool: + return self.available_themes != {} + def __str__(self): # for backwards compatibility return 'code'