From 1bfb5da7b4e40955ac38abf4c3441194fa821b63 Mon Sep 17 00:00:00 2001 From: Vishal Date: Wed, 19 Jun 2024 18:59:26 +0530 Subject: [PATCH 01/11] Adding release date to changelog window --- plugin_manager.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index 81844db..faed684 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -941,8 +941,9 @@ class ChangelogWindow(popup.PopupWindow): bui.textwidget(parent=self._root_widget, position=(width * 0.49, height * 0.72), size=(0, 0), - h_align='center', v_align='center', text=PLUGIN_MANAGER_VERSION, - scale=text_scale * 1.1, color=color, + h_align='center', v_align='center', + text=PLUGIN_MANAGER_VERSION + _CACHE['changelog']['released_on'], + scale=text_scale * 0.9, color=color, maxwidth=width * 0.9) bui.buttonwidget( @@ -954,7 +955,7 @@ class ChangelogWindow(popup.PopupWindow): button_type='square', on_activate_call=lambda: bui.open_url(REPOSITORY_URL + '/blob/main/CHANGELOG.md')) - logs = _CACHE['changelog'].split('\n') + logs = _CACHE['changelog']['info'].split('\n') loop_height = height * 0.62 for log in logs: bui.textwidget(parent=self._root_widget, @@ -1418,15 +1419,20 @@ class PluginManager: full_changelog = await self.get_changelog() if full_changelog[1]: pattern = rf"### {version} \(\d\d-\d\d-\d{{4}}\)\n(.*?)(?=### \d+\.\d+\.\d+|\Z)" + released_on = full_changelog[0].split(version)[1].split('\n')[0] matches = re.findall(pattern, full_changelog[0], re.DOTALL) if matches: - changelog = matches[0].strip() + changelog = { + 'released_on': released_on, + 'info': matches[0].strip() + } else: changelog = f"Changelog entry for version {version} not found." else: changelog = full_changelog[0] except urllib.error.URLError: - changelog = 'Could not get ChangeLog due to Internet Issues.' + changelog = {'released_on': '(Not Provided)', + 'info': 'Could not get ChangeLog due to Internet Issues.'} self.set_changelog_global_cache(changelog) self._changelog_setup_in_progress = False From b8efbd288b5143a12340f2e8c60a0742f5005840 Mon Sep 17 00:00:00 2001 From: Vishal Date: Wed, 19 Jun 2024 19:14:23 +0530 Subject: [PATCH 02/11] A small ui fix --- plugin_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin_manager.py b/plugin_manager.py index faed684..3962877 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1431,7 +1431,7 @@ class PluginManager: else: changelog = full_changelog[0] except urllib.error.URLError: - changelog = {'released_on': '(Not Provided)', + changelog = {'released_on': ' (Not Provided)', 'info': 'Could not get ChangeLog due to Internet Issues.'} self.set_changelog_global_cache(changelog) self._changelog_setup_in_progress = False From e80d8b76a5e9452854b065ccd37d753333c1c805 Mon Sep 17 00:00:00 2001 From: Vishal Date: Wed, 19 Jun 2024 21:15:42 +0530 Subject: [PATCH 03/11] Adding movement to Loading and Refreshing text --- plugin_manager.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index 3962877..11309df 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1823,13 +1823,14 @@ class PluginManagerWindow(bui.Window): parent=self._root_widget, position=(-5, loading_pos_y), size=(self._width, 25), - text="Loading...", + text="Loading", color=bui.app.ui_v1.title_color, scale=0.7, h_align="center", v_align="center", maxwidth=400, ) + self._dot_timer = babase.AppTimer(0.5, self._update_dots, repeat=True) def _back(self) -> None: from bauiv1lib.settings.allsettings import AllSettingsWindow @@ -1852,6 +1853,7 @@ class PluginManagerWindow(bui.Window): try: yield except urllib.error.URLError: + self._dot_timer = None 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 @@ -1859,10 +1861,19 @@ class PluginManagerWindow(bui.Window): # User probably went back before a bui.Window could finish loading. pass except Exception as e: + self._dot_timer = None bui.textwidget(edit=self._plugin_manager_status_text, text=str(e)) raise + def _update_dots(self): + text = cast(str, bui.textwidget(query=self._plugin_manager_status_text)) + if text.endswith('....'): + text = text[0:len(text)-4] + text = text + '.' + bui.textwidget(edit=self._plugin_manager_status_text, + text=text) + async def draw_index(self): self.draw_search_bar() self.draw_plugins_scroll_bar() @@ -1872,6 +1883,7 @@ class PluginManagerWindow(bui.Window): await self.plugin_manager.setup_changelog() with self.exception_handler(): await self.plugin_manager.setup_index() + self._dot_timer = None bui.textwidget(edit=self._plugin_manager_status_text, text="") await self.select_category("All") @@ -2215,12 +2227,15 @@ class PluginManagerWindow(bui.Window): async def refresh(self): self.cleanup() bui.textwidget(edit=self._plugin_manager_status_text, - text="Refreshing...") + text="Refreshing") + if self._dot_timer is None: + self._dot_timer = babase.AppTimer(0.5, self._update_dots, repeat=True) with self.exception_handler(): await self.plugin_manager.refresh() await self.plugin_manager.setup_changelog() await self.plugin_manager.setup_index() + self._dot_timer = None bui.textwidget(edit=self._plugin_manager_status_text, text="") await self.select_category(self.selected_category) From 4640b821cfc72a5b1b55f7533615de4a31043b93 Mon Sep 17 00:00:00 2001 From: Vishal Date: Wed, 19 Jun 2024 21:27:58 +0530 Subject: [PATCH 04/11] Small fixes --- plugin_manager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index 11309df..94be03e 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -24,7 +24,7 @@ import hashlib import copy import traceback -from typing import Union, Optional +from typing import Union, Optional, cast from datetime import datetime # Modules used for overriding AllSettingsWindow @@ -1427,7 +1427,8 @@ class PluginManager: 'info': matches[0].strip() } else: - changelog = f"Changelog entry for version {version} not found." + changelog = {'released_on': ' (Not Provided)', + 'info': f"Changelog entry for version {version} not found."} else: changelog = full_changelog[0] except urllib.error.URLError: @@ -1880,8 +1881,8 @@ class PluginManagerWindow(bui.Window): self.draw_category_selection_button(post_label="All") self.draw_refresh_icon() self.draw_settings_icon() - await self.plugin_manager.setup_changelog() with self.exception_handler(): + await self.plugin_manager.setup_changelog() await self.plugin_manager.setup_index() self._dot_timer = None bui.textwidget(edit=self._plugin_manager_status_text, From 0ebf41e2aa8408ac4237848d0782f1c875f92f33 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 8 Aug 2024 01:49:31 +0530 Subject: [PATCH 05/11] Few Error and UI Fixes --- plugin_manager.py | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index 94be03e..c9c15f2 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -939,10 +939,21 @@ class ChangelogWindow(popup.PopupWindow): bui.containerwidget(edit=self._root_widget, cancel_button=back_button) + try: + released_on = _CACHE['changelog']['released_on'] + logs = _CACHE['changelog']['info'].split('\n') + h_align = 'left' + extra = 0.1 + except KeyError: + released_on = '' + logs = ["Could not load ChangeLog"] + h_align = 'center' + extra = 1 + bui.textwidget(parent=self._root_widget, position=(width * 0.49, height * 0.72), size=(0, 0), h_align='center', v_align='center', - text=PLUGIN_MANAGER_VERSION + _CACHE['changelog']['released_on'], + text=PLUGIN_MANAGER_VERSION + released_on, scale=text_scale * 0.9, color=color, maxwidth=width * 0.9) @@ -959,8 +970,8 @@ class ChangelogWindow(popup.PopupWindow): loop_height = height * 0.62 for log in logs: bui.textwidget(parent=self._root_widget, - position=(width * 0.05, loop_height), size=(0, 0), - h_align='left', v_align='top', text=log, + position=(width * 0.5 * extra, loop_height), size=(0, 0), + h_align=h_align, v_align='top', text=log, scale=text_scale, color=color, maxwidth=width * 0.9) loop_height -= 35 @@ -2346,8 +2357,13 @@ class PluginManagerSettingsWindow(popup.PopupWindow): maxwidth=width * 0.95) pos -= 75 + try: + plugin_manager_update_available = await self._plugin_manager.get_update_details() + except urllib.error.URLError: + plugin_manager_update_available = False + discord_width = (width * 0.20) if plugin_manager_update_available else (width * 0.31) self.discord_button = bui.buttonwidget(parent=self._root_widget, - position=((width * 0.20) - button_size[0] / 2, pos), + position=(discord_width - button_size[0] / 2, pos), size=button_size, on_activate_call=lambda: bui.open_url(DISCORD_URL), textcolor=b_text_color, @@ -2357,14 +2373,15 @@ class PluginManagerSettingsWindow(popup.PopupWindow): label="") bui.imagewidget(parent=self._root_widget, - position=((width * 0.20)+0.5 - button_size[0] / 2, pos), + position=(discord_width+0.5 - button_size[0] / 2, pos), size=button_size, texture=bui.gettexture("discordLogo"), color=discord_fg_color, draw_controller=self.discord_button) + github_width = (width * 0.49) if plugin_manager_update_available else (width * 0.65) self.github_button = bui.buttonwidget(parent=self._root_widget, - position=((width * 0.49) - button_size[0] / 2, pos), + position=(github_width - button_size[0] / 2, pos), size=button_size, on_activate_call=lambda: bui.open_url(REPOSITORY_URL), textcolor=b_text_color, @@ -2374,7 +2391,7 @@ class PluginManagerSettingsWindow(popup.PopupWindow): label='') bui.imagewidget(parent=self._root_widget, - position=((width * 0.49) + 0.5 - button_size[0] / 2, pos), + position=(github_width + 0.5 - button_size[0] / 2, pos), size=button_size, texture=bui.gettexture("githubLogo"), color=(1, 1, 1), From b3601787f56e46c9691457045044f6b0dd6ed2ed Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 8 Aug 2024 02:39:51 +0530 Subject: [PATCH 06/11] Fixing a mistake I made --- plugin_manager.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugin_manager.py b/plugin_manager.py index c9c15f2..1b9bb20 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -966,7 +966,6 @@ class ChangelogWindow(popup.PopupWindow): button_type='square', on_activate_call=lambda: bui.open_url(REPOSITORY_URL + '/blob/main/CHANGELOG.md')) - logs = _CACHE['changelog']['info'].split('\n') loop_height = height * 0.62 for log in logs: bui.textwidget(parent=self._root_widget, From 6071ec3578162d8a640e7ac848d3dc5bf10b234b Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 8 Aug 2024 03:04:04 +0530 Subject: [PATCH 07/11] Fixing another UI thing --- plugin_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin_manager.py b/plugin_manager.py index 1b9bb20..94f171f 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -2164,6 +2164,8 @@ class PluginManagerWindow(bui.Window): for plugin in self._columnwidget.get_children(): plugin.delete() + text_widget = bui.textwidget(parent=self._columnwidget) + text_widget.delete() await asyncio.gather(*plugin_names_to_draw) From c8c1b8fa01ce78ca09976286a75fc61fb180344a Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 8 Aug 2024 03:14:30 +0530 Subject: [PATCH 08/11] v1.0.22 --- index.json | 1 + plugin_manager.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.json b/index.json index b8341dc..ccd05b4 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.22": null, "1.0.21": { "api_version": 8, "commit_sha": "b1a3aaa", diff --git a/plugin_manager.py b/plugin_manager.py index 94f171f..6647464 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.21" +PLUGIN_MANAGER_VERSION = "1.0.22" 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. From fd7bd3c3b998bd7c3ec45cd7af3e14eb3bc086d8 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 8 Aug 2024 03:16:41 +0530 Subject: [PATCH 09/11] Updated Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c76330..448a5d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Plugin Manager (dd-mm-yyyy) +### 1.0.22 (07-08-2024) + +- Fixed a few Errors and UI Bugs. + ### 1.0.21 (20-05-2024) - Fixed an error related with notification of new plugins. From 719c1046f139d4db9d83391265e45d4de3748466 Mon Sep 17 00:00:00 2001 From: vishal332008 Date: Wed, 7 Aug 2024 21:48:12 +0000 Subject: [PATCH 10/11] [ci] auto-format --- plugin_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin_manager.py b/plugin_manager.py index 6647464..5f85602 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -953,7 +953,7 @@ class ChangelogWindow(popup.PopupWindow): bui.textwidget(parent=self._root_widget, position=(width * 0.49, height * 0.72), size=(0, 0), h_align='center', v_align='center', - text=PLUGIN_MANAGER_VERSION + released_on, + text=PLUGIN_MANAGER_VERSION + released_on, scale=text_scale * 0.9, color=color, maxwidth=width * 0.9) From 684b490f58df9f5d35a79740ae7bf36f67808409 Mon Sep 17 00:00:00 2001 From: vishal332008 Date: Wed, 7 Aug 2024 21:48:13 +0000 Subject: [PATCH 11/11] [ci] apply-version-metadata --- index.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.json b/index.json index ccd05b4..7098845 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.22": null, + "1.0.22": { + "api_version": 8, + "commit_sha": "719c104", + "released_on": "07-08-2024", + "md5sum": "9c431e0eff32a16070afb7f59a5f0046" + }, "1.0.21": { "api_version": 8, "commit_sha": "b1a3aaa",