diff -r 08a5a019bed2 -r 16066300b254 svghmi/svghmi.py
--- a/svghmi/svghmi.py Mon Jul 12 14:13:29 2021 +0200
+++ b/svghmi/svghmi.py Mon Jul 12 16:29:55 2021 +0200
@@ -535,7 +535,10 @@
else:
target_file = open(target_path, 'wb')
target_file.write("""
-
+
+
+SVGHMI
+
No SVG file provided
@@ -548,6 +551,8 @@
port = self.GetParamsAttributes("SVGHMI.Port")["value"]
interface = self.GetParamsAttributes("SVGHMI.Interface")["value"]
path = self.GetParamsAttributes("SVGHMI.Path")["value"].format(name=view_name)
+ if path and path[0]=='/':
+ path = path[1:]
enable_watchdog = self.GetParamsAttributes("SVGHMI.EnableWatchdog")["value"]
url="http://"+interface+("" if port==80 else (":"+str(port))
) + (("/"+path) if path else ""
@@ -672,7 +677,9 @@
dialog.Destroy()
if open_inkscape:
if not os.path.isfile(svgfile):
- svgfile = None
+ # make a copy of default svg from source
+ default = os.path.join(ScriptDirectory, "default.svg")
+ shutil.copyfile(default, svgfile)
open_svg(svgfile)
def _StartPOEdit(self, POFile):