changeset 1471:83dce05226ac

pages: workaround to expose variables coming from python-dbus
author Goffi <goffi@goffi.org>
date Fri, 15 Oct 2021 21:13:35 +0200
parents 837ae0c4b858
children 915c7c2f1729
files libervia/server/pages.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/server/pages.py	Fri Oct 01 16:30:05 2021 +0200
+++ b/libervia/server/pages.py	Fri Oct 15 21:13:35 2021 +0200
@@ -577,6 +577,10 @@
         for name, value in kwargs.items():
             if value is None:
                 value = "null"
+            elif isinstance(value, str):
+                # FIXME: workaround for subtype used by python-dbus (dbus.String)
+                #   to be removed when we get rid of python-dbus
+                value = repr(str(value))
             else:
                 value = repr(value)
             scripts.add(Script(content=f"var {name}={value};"))