beremiz

SVGHMI: fix runtime exception when browser commands are empty.
py2compat
19 months ago, Edouard Tisserant
1f4f9f64f238
Parents d570b0671c24
Children 1cfc96c756f9
SVGHMI: fix runtime exception when browser commands are empty.
--- a/svghmi/svghmi.py Wed Nov 13 14:42:34 2024 +0100
+++ b/svghmi/svghmi.py Fri Nov 15 14:27:55 2024 +0100
@@ -633,10 +633,11 @@
svghmi_cmds = {}
for thing in ["Start", "Stop", "Watchdog"]:
given_command = self.GetParamsAttributes("SVGHMI.On"+thing)["value"]
+ formated_command = given_command.format(**svghmi_options).strip()
svghmi_cmds[thing] = (
"Popen(" +
- repr(shlex.split(given_command.format(**svghmi_options))) +
- ")") if given_command else "None # no command given"
+ repr(shlex.split(formated_command)) +
+ ")") if formated_command else "None # no command given"
runtimefile_path = os.path.join(buildpath, "runtime_%s_svghmi_.py" % location_str)
runtimefile = open(runtimefile_path, 'w')