diff libervia/server/pages.py @ 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 a410db730301
children b4cead3cea43
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};"))