From 8df912976461bb4919e6e0ea6b5f612eeb68a039 Mon Sep 17 00:00:00 2001 From: miro Date: Tue, 5 Nov 2024 00:57:23 +0000 Subject: [PATCH] fix: typing and init --- ovos_gui_plugin_shell_companion/__init__.py | 25 +++++++++------------ 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/ovos_gui_plugin_shell_companion/__init__.py b/ovos_gui_plugin_shell_companion/__init__.py index 0d03ffa..b52e7f2 100644 --- a/ovos_gui_plugin_shell_companion/__init__.py +++ b/ovos_gui_plugin_shell_companion/__init__.py @@ -4,7 +4,8 @@ from ovos_bus_client import Message from ovos_bus_client.apis.gui import GUIInterface from ovos_bus_client.client import MessageBusClient -from ovos_config.config import Configuration +from ovos_bus_client.util import get_mycroft_bus +from ovos_config import Configuration from ovos_plugin_manager.templates.gui import GUIExtension from ovos_utils import network_utils from ovos_utils.log import LOG @@ -23,25 +24,19 @@ class OVOSShellCompanionExtension(GUIExtension): Args: config: plugin configuration bus: MessageBus instance - gui: GUI instance - preload_gui (bool): load GUI skills even if gui client not connected - permanent (bool): disable unloading of GUI skills on gui client disconnections """ - def __init__(self, config: dict, bus: MessageBusClient = None, - gui: GUIInterface = None, - preload_gui=False, permanent=True): + def __init__(self, config: dict, bus: MessageBusClient = None): + LOG.info("OVOS Shell: Initializing") + bus = bus or get_mycroft_bus() config["homescreen_supported"] = True res_dir = join(dirname(__file__), "gui") - gui = gui or GUIInterface("ovos_gui_plugin_shell_companion", - bus=bus, config=Configuration(), - ui_directories={"qt5": join(res_dir, "qt5")}) - if not gui.ui_directories: - LOG.info(f"Setting default qt5 resource directory to: {res_dir}/qt5") - gui.ui_directories["qt5"] = join(res_dir, "qt5") - LOG.info("OVOS Shell: Initializing") + 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") super().__init__(config=config, bus=bus, gui=gui, - preload_gui=preload_gui, permanent=permanent) + preload_gui=False, permanent=True) self.about_page_data = [] self.build_initial_about_page_data()