svghmi/svghmi.py
branchsvghmi
changeset 2812 68ac5bf43525
parent 2789 ba0dd2ec6dc4
child 2814 2cabc4773885
--- a/svghmi/svghmi.py	Wed Oct 30 15:17:05 2019 +0100
+++ b/svghmi/svghmi.py	Thu Nov 07 16:40:48 2019 +0100
@@ -340,10 +340,10 @@
 
         res = ([], "", False)
 
-        target_fname = "sghmi_"+location_str+".xhtml"
+        target_fname = "svghmi_"+location_str+".xhtml"
 
         target_path = os.path.join(self._getBuildPath(), target_fname)
-        target_file = open(target_path, 'w')
+        target_file = open(target_path, 'wb')
 
         if os.path.exists(svgfile):
 
@@ -385,7 +385,7 @@
         runtimefile = open(runtimefile_path, 'w')
         runtimefile.write("""
 def _runtime_svghmi1_%(location)s_start():
-    svghmi_root.putChild('%(view_name)s',File('%(xhtml)s'))
+    svghmi_root.putChild('%(view_name)s',File('%(xhtml)s', defaultType='application/xhtml+xml'))
 
 def _runtime_svghmi1_%(location)s_stop():
     svghmi_root.delEntity('%(view_name)s')