# HG changeset patch # User Edouard Tisserant # Date 1603146232 -7200 # Node ID 466c3df6783508b4e345b1218718f90ee4b8afe3 # Parent 6ea4b7e1a9ed5c25dfd070227118507b42cf5852 PY_EXT: OnChange is now a coma separated list of callables. Updated tests/python accordingly. diff -r 6ea4b7e1a9ed -r 466c3df67835 py_ext/PythonFileCTNMixin.py --- a/py_ext/PythonFileCTNMixin.py Thu Sep 17 11:30:22 2020 +0200 +++ b/py_ext/PythonFileCTNMixin.py Tue Oct 20 00:23:52 2020 +0200 @@ -111,7 +111,8 @@ configname = self.GetCTRoot().GetProjectConfigNames()[0] def _onchangecode(var): - return var.getonchange() + "('" + var.getname() + "')" + return [onchangecall.strip() + "('" + var.getname() + "')" + for onchangecall in var.getonchange().split(',')] def _onchange(var): return repr(var.getonchange()) \ @@ -159,7 +160,9 @@ if changes.next(): # %(name)s try: - %(onchangecode)s +""" % varinfo + """ + """ + """ + """.join(varinfo['onchangecode'])+""" except Exception as e: errors.append("%(name)s: "+str(e)) """ % varinfo for varinfo in varinfos if varinfo["onchange"]]) diff -r 6ea4b7e1a9ed -r 466c3df67835 tests/python/plc.xml --- a/tests/python/plc.xml Thu Sep 17 11:30:22 2020 +0200 +++ b/tests/python/plc.xml Tue Oct 20 00:23:52 2020 +0200 @@ -1,7 +1,7 @@ - + diff -r 6ea4b7e1a9ed -r 466c3df67835 tests/python/py_ext_0@py_ext/pyfile.xml --- a/tests/python/py_ext_0@py_ext/pyfile.xml Thu Sep 17 11:30:22 2020 +0200 +++ b/tests/python/py_ext_0@py_ext/pyfile.xml Tue Oct 20 00:23:52 2020 +0200 @@ -2,7 +2,7 @@ - +