diff libervia/backend/bridge/dbus_bridge.py @ 4193:730f542e4ad0

core: add new `init_script_path` option: `init_script_path` option can be used in `[DEFAULTS]` to run a script at the end of backend initialisation. A new `init_pre_script` method is used to wait for backend to reach this stage (designed to be used mostly by CLI frontend), then the usual `ready_get` method is finished once the script is finished.
author Goffi <goffi@goffi.org>
date Wed, 13 Dec 2023 22:00:22 +0100
parents a8a0fa678ce2
children 0d7bb4df2343
line wrap: on
line diff
--- a/libervia/backend/bridge/dbus_bridge.py	Tue Dec 12 12:17:15 2023 +0100
+++ b/libervia/backend/bridge/dbus_bridge.py	Wed Dec 13 22:00:22 2023 +0100
@@ -114,6 +114,7 @@
         Method('image_convert', arguments='ssss', returns='s'),
         Method('image_generate_preview', arguments='ss', returns='s'),
         Method('image_resize', arguments='sii', returns='s'),
+        Method('init_pre_script', arguments='', returns=''),
         Method('is_connected', arguments='s', returns='b'),
         Method('main_resource_get', arguments='ss', returns='s'),
         Method('menu_help_get', arguments='ss', returns='s'),
@@ -281,6 +282,9 @@
     def dbus_image_resize(self, image_path, width, height):
         return self._callback("image_resize", image_path, width, height)
 
+    def dbus_init_pre_script(self, ):
+        return self._callback("init_pre_script", )
+
     def dbus_is_connected(self, profile_key="@DEFAULT@"):
         return self._callback("is_connected", profile_key)