merge svghmi
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Wed, 18 Nov 2020 23:08:17 +0100
branchsvghmi
changeset 3073 1f5a5282c41f
parent 3071 e1145e6bdeec (current diff)
parent 3072 152414c550f3 (diff)
child 3074 2ec1aebda927
merge
--- a/py_ext/PythonFileCTNMixin.py	Wed Nov 18 23:06:16 2020 +0100
+++ b/py_ext/PythonFileCTNMixin.py	Wed Nov 18 23:08:17 2020 +0100
@@ -121,8 +121,13 @@
         configname = self.GetCTRoot().GetProjectConfigNames()[0]
 
         def _onchangecode(var):
-            return [onchangecall.strip() + "('" + var.getname() + "')"
-                    for onchangecall in self.GetVarOnChangeContent(var).split(',')]
+            result = []
+            for onchangecall in self.GetVarOnChangeContent(var).split(','):
+                onchangecall = onchangecall.strip()
+                if onchangecall:
+                    result.append(onchangecall + "('" + var.getname() + "')")
+            return result
+
 
         def _onchange(var):
             content = self.GetVarOnChangeContent(var)
@@ -169,8 +174,7 @@
         on_change_func_body = "\n".join(["""
     if changes.next():
         # %(name)s
-        try:
-""" % varinfo + """ 
+        try:""" % varinfo + """
             """ + """
             """.join(varinfo['onchangecode'])+"""
         except Exception as e: