From 6e4704126c1f1cfccf2d97ab7dbce7038722d305 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Tue, 5 Nov 2024 01:35:37 +0000 Subject: [PATCH] fix: init - accidentally remove gui kwarg (#45) the rabbit warned me! --- ovos_gui_plugin_shell_companion/__init__.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ovos_gui_plugin_shell_companion/__init__.py b/ovos_gui_plugin_shell_companion/__init__.py index b52e7f2..4e9542e 100644 --- a/ovos_gui_plugin_shell_companion/__init__.py +++ b/ovos_gui_plugin_shell_companion/__init__.py @@ -1,5 +1,6 @@ import platform from os.path import join, dirname +from typing import Optional, Any, Dict from ovos_bus_client import Message from ovos_bus_client.apis.gui import GUIInterface @@ -26,15 +27,18 @@ class OVOSShellCompanionExtension(GUIExtension): bus: MessageBus instance """ - def __init__(self, config: dict, bus: MessageBusClient = None): + def __init__(self, config: Dict[str, Any], + bus: Optional[MessageBusClient] = None, + gui: Optional[GUIInterface] = None): LOG.info("OVOS Shell: Initializing") bus = bus or get_mycroft_bus() config["homescreen_supported"] = True res_dir = join(dirname(__file__), "gui") - gui = GUIInterface("ovos_gui_plugin_shell_companion", - bus=bus, config=Configuration().get("gui", {}), - ui_directories={"qt5": join(res_dir, "qt5")}) - LOG.info(f"Setting default qt5 resource directory to: {res_dir}/qt5") + gui = gui or GUIInterface("ovos_gui_plugin_shell_companion", + bus=bus, config=Configuration().get("gui", {}), + ui_directories={"qt5": join(res_dir, "qt5")}) + gui.ui_directories["qt5"] = join(res_dir, "qt5") + LOG.info(f"Shell companion: qt5 resources directory: {res_dir}/qt5") super().__init__(config=config, bus=bus, gui=gui, preload_gui=False, permanent=True) self.about_page_data = []