--- a/exemples/svghmi_traffic_light/svghmi_0@svghmi/confnode.xml Wed May 25 09:18:37 2022 +0200
+++ b/exemples/svghmi_traffic_light/svghmi_0@svghmi/confnode.xml Wed May 25 20:00:31 2022 +0200
@@ -1,2 +1,2 @@
<?xml version='1.0' encoding='utf-8'?>
-<SVGHMI xmlns:xsd="http://www.w3.org/2001/XMLSchema" OnWatchdog="echo Watchdog for {name} !" WatchdogInitial="10" WatchdogInterval="5" EnableWatchdog="true" Path="{name}"/>
+<SVGHMI xmlns:xsd="http://www.w3.org/2001/XMLSchema" WatchdogInitial="10" WatchdogInterval="5" EnableWatchdog="true" Path="{name}"/> --- a/svghmi/svghmi.py Wed May 25 09:18:37 2022 +0200
+++ b/svghmi/svghmi.py Wed May 25 20:00:31 2022 +0200
@@ -299,18 +299,22 @@
if wx.Platform == '__WXMSW__':
- browser_launch_cmd="cmd.exe /c 'start msedge {url}'"
+ "launch":"cmd.exe /c 'start msedge {url}'", + "watchdog":"cmd.exe /k 'echo watchdog for {url} !'"} - browser_launch_cmd="chromium {url}"
+ "launch":"chromium {url}", + "watchdog":"echo Watchdog for {name} !"} XSD = """<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="SVGHMI">
- <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="%s"/>
+ <xsd:attribute name="OnStart" type="xsd:string" use="optional" default="%(launch)s"/> <xsd:attribute name="OnStop" type="xsd:string" use="optional" default=""/>
- <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default=""/>
+ <xsd:attribute name="OnWatchdog" type="xsd:string" use="optional" default="%(watchdog)s"/> <xsd:attribute name="EnableWatchdog" type="xsd:boolean" use="optional" default="false"/>
<xsd:attribute name="WatchdogInitial" use="optional" default="30">
@@ -342,7 +346,7 @@
EditorType = SVGHMIEditor
@@ -399,9 +403,13 @@
if from_project_path is not None:
shutil.copyfile(self._getSVGpath(from_project_path),
- shutil.copyfile(self._getPOTpath(from_project_path),
- # XXX TODO copy .PO files
+ potpath = self._getPOTpath(from_project_path) + if os.path.isfile(potpath): + shutil.copyfile(potpath, self._getPOTpath()) + for _name, pofile in GetPoFiles(from_project_path): + shutil.copy(pofile, self.CTNPath()) def GetSVGGeometry(self):
--- a/util/misc.py Wed May 25 09:18:37 2022 +0200
+++ b/util/misc.py Wed May 25 20:00:31 2022 +0200
@@ -45,9 +45,9 @@
dirs[:] = [d for d in dirs if not d[0] == '.']
if sys.platform.startswith('win'):
- testdirpath = os.path.join(root, "testdir_", random.randint(0, 4294967296))
+ testdirpath = os.path.join(root, "testdir_" + str(random.randint(0, 4294967296)))