From 0d7079f0a0d7c0c08b50e2a7f1d109b48da9fdf8 Mon Sep 17 00:00:00 2001 From: Vishal Date: Wed, 24 Apr 2024 03:44:11 +0530 Subject: [PATCH 01/14] Update plugin_manager.py --- plugin_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin_manager.py b/plugin_manager.py index bea4f69..a247dc0 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1180,7 +1180,7 @@ class PluginWindow(popup.PopupWindow): if self.plugin.is_installed: selected_btn = bui.buttonwidget(parent=self._root_widget, - position=(width * (0.4 if has_update else 0.55), pos), + position=(width * (0.4 if has_update or not to_draw_button1 else 0.55), pos), size=button_size, on_activate_call=button2_action, color=b2_color, From 12cadaab4c4ebc1942ca1ea0999bf59802511a56 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 25 Apr 2024 18:20:00 +0530 Subject: [PATCH 02/14] Fix error caused when cant get changelog --- CHANGELOG.md | 4 ++++ index.json | 1 + plugin_manager.py | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 068f59a..befb9fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Plugin Manager (dd-mm-yyyy) +### 1.0.18 (25-04-2024) + +- Fix error caused when cant get changelog + ### 1.0.17 (22-04-2024) - Added ChangeLog Window to view latest changes. diff --git a/index.json b/index.json index bae8046..4871597 100644 --- a/index.json +++ b/index.json @@ -1,6 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { + "1.0.18": null, "1.0.17": { "api_version": 8, "commit_sha": "02530f0", diff --git a/plugin_manager.py b/plugin_manager.py index a247dc0..fb5d02e 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -31,7 +31,7 @@ from datetime import datetime from threading import Thread import logging -PLUGIN_MANAGER_VERSION = "1.0.17" +PLUGIN_MANAGER_VERSION = "1.0.18" REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager" # Current tag can be changed to "staging" or any other branch in # plugin manager repo for testing purpose. @@ -104,7 +104,7 @@ REGEXP = { DISCORD_URL = "https://ballistica.net/discord" -_CACHE = {} +_CACHE = {"changelog": "None"} class MD5CheckSumFailed(Exception): From 55660d476913b4a6d8c543e18710d632830c5673 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Sun, 28 Apr 2024 16:43:41 +0000 Subject: [PATCH 03/14] [ci] auto-format --- plugin_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin_manager.py b/plugin_manager.py index fb5d02e..9ac6305 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1180,7 +1180,8 @@ class PluginWindow(popup.PopupWindow): if self.plugin.is_installed: selected_btn = bui.buttonwidget(parent=self._root_widget, - position=(width * (0.4 if has_update or not to_draw_button1 else 0.55), pos), + position=( + width * (0.4 if has_update or not to_draw_button1 else 0.55), pos), size=button_size, on_activate_call=button2_action, color=b2_color, From c0a35b0803996ea58eca375bf9ee4171277441ce Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Sun, 28 Apr 2024 16:43:42 +0000 Subject: [PATCH 04/14] [ci] apply-version-metadata --- index.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.json b/index.json index 4871597..bf97ffa 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "1.0.18": null, + "1.0.18": { + "api_version": 8, + "commit_sha": "55660d4", + "released_on": "28-04-2024", + "md5sum": "7e3bca2eb19f68e9340c2d3e8622f213" + }, "1.0.17": { "api_version": 8, "commit_sha": "02530f0", From 30485235c2671d6a66df1e6de58e93c76e03c94e Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 29 Apr 2024 02:19:04 +0530 Subject: [PATCH 05/14] Fixing up a few errors for non-internet mode --- index.json | 7 +------ plugin_manager.py | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/index.json b/index.json index bf97ffa..4871597 100644 --- a/index.json +++ b/index.json @@ -1,12 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "1.0.18": { - "api_version": 8, - "commit_sha": "55660d4", - "released_on": "28-04-2024", - "md5sum": "7e3bca2eb19f68e9340c2d3e8622f213" - }, + "1.0.18": null, "1.0.17": { "api_version": 8, "commit_sha": "02530f0", diff --git a/plugin_manager.py b/plugin_manager.py index 9ac6305..2108448 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -104,7 +104,7 @@ REGEXP = { DISCORD_URL = "https://ballistica.net/discord" -_CACHE = {"changelog": "None"} +_CACHE = {} class MD5CheckSumFailed(Exception): @@ -1405,7 +1405,10 @@ class PluginManager: # Rather wait for the previous network call to complete. await asyncio.sleep(0.1) self._changelog_setup_in_progress = not bool(self._changelog) - full_changelog = await self.get_changelog() + try: + full_changelog = await self.get_changelog() + except Exception: + full_changelog = 'Could not get ChangeLog' pattern = rf"### {version} \(\d\d-\d\d-\d{{4}}\)\n(.*?)(?=### \d+\.\d+\.\d+|\Z)" matches = re.findall(pattern, full_changelog, re.DOTALL) if matches: @@ -1457,7 +1460,6 @@ class PluginManager: async def refresh(self): self.cleanup() await self.setup_index() - await self.setup_changelog() def set_index_global_cache(self, index): _CACHE["index"] = index @@ -1733,7 +1735,7 @@ class PluginManagerWindow(bui.Window): def __init__(self, transition: str = "in_right", origin_widget: bui.Widget = None): self.plugin_manager = PluginManager() self.category_selection_button = None - self.selected_category = None + self.selected_category = 'All' self.plugins_in_current_view = {} self.selected_alphabet_order = 'a_z' self.alphabet_order_selection_button = None @@ -1832,6 +1834,7 @@ class PluginManagerWindow(bui.Window): except urllib.error.URLError: bui.textwidget(edit=self._plugin_manager_status_text, text="Make sure you are connected\n to the Internet and try again.") + self.plugin_manager._index_setup_in_progress = False except RuntimeError: # User probably went back before a bui.Window could finish loading. pass @@ -2077,7 +2080,11 @@ class PluginManagerWindow(bui.Window): try: category_plugins = await self.plugin_manager.categories[category if category != 'Installed' else 'All'].get_plugins() except (KeyError, AttributeError): - raise CategoryDoesNotExist(f"{category} does not exist.") + no_internet_text = "Make sure you are connected\n to the Internet and try again." + if bui.textwidget(query=self._plugin_manager_status_text) != no_internet_text: + raise CategoryDoesNotExist(f"{category} does not exist.") + else: + return if search_term: plugins = list(filter( @@ -2184,6 +2191,7 @@ class PluginManagerWindow(bui.Window): with self.exception_handler(): await self.plugin_manager.refresh() + await self.plugin_manager.setup_changelog() await self.plugin_manager.setup_index() bui.textwidget(edit=self._plugin_manager_status_text, text="") From 0d37f14bb7bc18fdb024488f557735a90833a68f Mon Sep 17 00:00:00 2001 From: vishal332008 Date: Sun, 28 Apr 2024 20:49:26 +0000 Subject: [PATCH 06/14] [ci] apply-version-metadata --- index.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.json b/index.json index 4871597..7aa7707 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "1.0.18": null, + "1.0.18": { + "api_version": 8, + "commit_sha": "3048523", + "released_on": "28-04-2024", + "md5sum": "d6bfcd47829f605806f68f39d40efc67" + }, "1.0.17": { "api_version": 8, "commit_sha": "02530f0", From e42fb09bdd0be3493b8d9087d56b000eaffa2907 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 29 Apr 2024 02:29:52 +0530 Subject: [PATCH 07/14] Fixing up a mistake --- index.json | 7 +------ plugin_manager.py | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/index.json b/index.json index 7aa7707..4871597 100644 --- a/index.json +++ b/index.json @@ -1,12 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "1.0.18": { - "api_version": 8, - "commit_sha": "3048523", - "released_on": "28-04-2024", - "md5sum": "d6bfcd47829f605806f68f39d40efc67" - }, + "1.0.18": null, "1.0.17": { "api_version": 8, "commit_sha": "02530f0", diff --git a/plugin_manager.py b/plugin_manager.py index 2108448..a07edb9 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1927,7 +1927,7 @@ class PluginManagerWindow(bui.Window): ) filter_text = bui.textwidget(parent=self._root_widget, query=self._filter_widget) await self.draw_plugin_names( - self.selected_category, refresh=True, order=self.selected_alphabet_order + self.selected_category, search_term=filter_text, refresh=True, order=self.selected_alphabet_order ) def draw_search_bar(self): From 0123dbedaad0105b3752fa128a4ffbe3b522e942 Mon Sep 17 00:00:00 2001 From: vishal332008 Date: Sun, 28 Apr 2024 21:00:14 +0000 Subject: [PATCH 08/14] [ci] apply-version-metadata --- index.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.json b/index.json index 4871597..462b782 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "1.0.18": null, + "1.0.18": { + "api_version": 8, + "commit_sha": "e42fb09", + "released_on": "28-04-2024", + "md5sum": "49b240dab5bc0b5adcfa6b807d756053" + }, "1.0.17": { "api_version": 8, "commit_sha": "02530f0", From f93afa90d0ffb5955d7e85c4f9b46a99321684f7 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 29 Apr 2024 02:36:36 +0530 Subject: [PATCH 09/14] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index befb9fa..2754fa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### 1.0.18 (25-04-2024) -- Fix error caused when cant get changelog +- Fixed errors which were caused due to no internet connection. ### 1.0.17 (22-04-2024) From 9936e76587684ec2017ab8c7617cf9baa439a477 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 29 Apr 2024 02:50:00 +0530 Subject: [PATCH 10/14] Specifying the exception --- index.json | 7 +------ plugin_manager.py | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/index.json b/index.json index 462b782..4871597 100644 --- a/index.json +++ b/index.json @@ -1,12 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "1.0.18": { - "api_version": 8, - "commit_sha": "e42fb09", - "released_on": "28-04-2024", - "md5sum": "49b240dab5bc0b5adcfa6b807d756053" - }, + "1.0.18": null, "1.0.17": { "api_version": 8, "commit_sha": "02530f0", diff --git a/plugin_manager.py b/plugin_manager.py index a07edb9..9fcab95 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1407,8 +1407,8 @@ class PluginManager: self._changelog_setup_in_progress = not bool(self._changelog) try: full_changelog = await self.get_changelog() - except Exception: - full_changelog = 'Could not get ChangeLog' + except urllib.error.URLError: + full_changelog = 'Could not get ChangeLog due to Internet Issues' pattern = rf"### {version} \(\d\d-\d\d-\d{{4}}\)\n(.*?)(?=### \d+\.\d+\.\d+|\Z)" matches = re.findall(pattern, full_changelog, re.DOTALL) if matches: From 517dc479763dc973b514c235370ce031ebe502af Mon Sep 17 00:00:00 2001 From: vishal332008 Date: Sun, 28 Apr 2024 21:20:22 +0000 Subject: [PATCH 11/14] [ci] apply-version-metadata --- index.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.json b/index.json index 4871597..38e6fee 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "1.0.18": null, + "1.0.18": { + "api_version": 8, + "commit_sha": "9936e76", + "released_on": "28-04-2024", + "md5sum": "9c5ad1c455c1e8388d19d803c9120d41" + }, "1.0.17": { "api_version": 8, "commit_sha": "02530f0", From 0092f0fc04f6909451c6bd258ba0391928400018 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 29 Apr 2024 02:51:25 +0530 Subject: [PATCH 12/14] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2754fa9..8f23d32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## Plugin Manager (dd-mm-yyyy) -### 1.0.18 (25-04-2024) +### 1.0.18 (28-04-2024) - Fixed errors which were caused due to no internet connection. From 5af504e9ca6462d139c574d9bbe9adcce71e2e90 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 29 Apr 2024 03:22:29 +0530 Subject: [PATCH 13/14] Fixing a few mistakes --- index.json | 7 +------ plugin_manager.py | 14 +++++++------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/index.json b/index.json index 38e6fee..4871597 100644 --- a/index.json +++ b/index.json @@ -1,12 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "1.0.18": { - "api_version": 8, - "commit_sha": "9936e76", - "released_on": "28-04-2024", - "md5sum": "9c5ad1c455c1e8388d19d803c9120d41" - }, + "1.0.18": null, "1.0.17": { "api_version": 8, "commit_sha": "02530f0", diff --git a/plugin_manager.py b/plugin_manager.py index 9fcab95..1e51970 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1407,14 +1407,14 @@ class PluginManager: self._changelog_setup_in_progress = not bool(self._changelog) try: full_changelog = await self.get_changelog() + pattern = rf"### {version} \(\d\d-\d\d-\d{{4}}\)\n(.*?)(?=### \d+\.\d+\.\d+|\Z)" + matches = re.findall(pattern, full_changelog, re.DOTALL) + if matches: + changelog = matches[0].strip() + else: + changelog = f"Changelog entry for version {version} not found." except urllib.error.URLError: - full_changelog = 'Could not get ChangeLog due to Internet Issues' - pattern = rf"### {version} \(\d\d-\d\d-\d{{4}}\)\n(.*?)(?=### \d+\.\d+\.\d+|\Z)" - matches = re.findall(pattern, full_changelog, re.DOTALL) - if matches: - changelog = matches[0].strip() - else: - changelog = f"Changelog entry for version {version} not found." + changelog = 'Could not get ChangeLog due to Internet Issues.' self.set_changelog_global_cache(changelog) self._changelog_setup_in_progress = False From ead10482054947706615fc85c2775a9257d34e81 Mon Sep 17 00:00:00 2001 From: vishal332008 Date: Sun, 28 Apr 2024 21:52:50 +0000 Subject: [PATCH 14/14] [ci] apply-version-metadata --- index.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.json b/index.json index 4871597..d9a571d 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "1.0.18": null, + "1.0.18": { + "api_version": 8, + "commit_sha": "5af504e", + "released_on": "28-04-2024", + "md5sum": "2c231693e686971a7cc4f12d1ffa3fdd" + }, "1.0.17": { "api_version": 8, "commit_sha": "02530f0",