# HG changeset patch
# User Edouard Tisserant <edouard@beremiz.fr>
# Date 1714126492 -7200
# Node ID 9719e0eeb6fff944aa4f526fd27f0a8fb3b7388d
# Parent  fc4af5685aa31d15436655528797b2a2e32ebbdf
SVGHMI: Do not generate Popen call when comamn is empty.

diff -r fc4af5685aa3 -r 9719e0eeb6ff svghmi/svghmi.py
--- a/svghmi/svghmi.py	Fri Apr 26 09:24:26 2024 +0200
+++ b/svghmi/svghmi.py	Fri Apr 26 12:14:52 2024 +0200
@@ -643,10 +643,11 @@
         svghmi_cmds = {}
         for thing in ["Start", "Stop", "Watchdog"]:
              given_command = self.GetParamsAttributes("SVGHMI.On"+thing)["value"]
+             args = shlex.split(given_command.format(**svghmi_options))
              svghmi_cmds[thing] = (
                 "Popen(" +
-                repr(shlex.split(given_command.format(**svghmi_options))) +
-                ")") if given_command else "None # no command given"
+                repr(args) +
+                ")") if args else "None # no command given"
 
         runtimefile_path = os.path.join(buildpath, "runtime_%s_svghmi_.py" % location_str)
         runtimefile = open(runtimefile_path, 'w')