svghmi/svghmi.py
changeset 3817 3deeda82636a
parent 3750 f62625418bff
child 3863 b076f52bd1c8
--- a/svghmi/svghmi.py	Wed May 31 10:38:03 2023 +0200
+++ b/svghmi/svghmi.py	Wed May 31 10:40:53 2023 +0200
@@ -427,13 +427,12 @@
         InkscapeGeomColumns = ["Id", "x", "y", "w", "h"]
 
         inkpath = get_inkscape_path()
-
         if inkpath is None:
             self.FatalError("SVGHMI: inkscape is not installed.")
 
         svgpath = self._getSVGpath()
         status, result, _err_result = ProcessLogger(self.GetCTRoot().logger,
-                                                     '"' + inkpath + '" -S "' + svgpath + '"',
+                                                     [inkpath, '-S', svgpath],
                                                      no_stdout=True,
                                                      no_stderr=True).spin()
         if status != 0:
@@ -611,7 +610,7 @@
                 # print(transform.xslt.error_log)
                 # print(etree.tostring(result.xslt_profile,pretty_print=True))
 
-                with open(hash_path, 'wb') as digest_file:
+                with open(hash_path, 'w') as digest_file:
                     digest_file.write(digest)
             else:
                 self.GetCTRoot().logger.write("    No changes - XSLT transformation skipped\n")
@@ -677,14 +676,14 @@
         factory = HMIWebSocketServerFactory()
         factory.setProtocolOptions(maxConnections={maxConnections})
 
-        svghmi_root.putChild("ws", WebSocketResource(factory))
+        svghmi_root.putChild(b"ws", WebSocketResource(factory))
 
         svghmi_listener = reactor.listenTCP({port}, Site(svghmi_root), interface='{interface}')
         path_list = []
         svghmi_servers["{interface}:{port}"] = (svghmi_root, svghmi_listener, path_list)
 
     svghmi_root.putChild(
-        '{path}',
+        b'{path}',
         NoCacheFile('{xhtml}',
             defaultType='application/xhtml+xml'))