Revert unwanted changes potentially breaking wxGlade support.
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Tue, 04 Jun 2024 14:09:16 +0200
changeset 3959 d5edde0c145b
parent 3958 d5fb90fd2a79
child 3960 9271afc4f34a
child 3961 f01bd9a40554
Revert unwanted changes potentially breaking wxGlade support.
Partly revert 34d4c77ccb1bcb14601ab347ec6080466b7e143d. Skips evaluator related changes that was included by mistake.
runtime/PLCObject.py
--- a/runtime/PLCObject.py	Tue Jun 04 08:35:13 2024 +0200
+++ b/runtime/PLCObject.py	Tue Jun 04 14:09:16 2024 +0200
@@ -330,7 +330,7 @@
 
         return False
 
-    def PythonRuntimeCall(self, methodname, reverse_order=False):
+    def PythonRuntimeCall(self, methodname, use_evaluator=True, reverse_order=False):
         """
         Calls init, start, stop or cleanup method provided by
         runtime python files, loaded when new PLC uploaded
@@ -339,7 +339,10 @@
         if reverse_order:
             methods = reversed(methods)
         for method in methods:
-            _res, exp = default_evaluator(method)
+            if use_evaluator:
+                _res, exp = self.evaluator(method)
+            else:
+                _res, exp = default_evaluator(method)
             if exp is not None:
                 self.LogMessage(0, '\n'.join(traceback.format_exception(*exp)))
 
@@ -403,7 +406,7 @@
             self.LogMessage(0, traceback.format_exc())
             raise
 
-        self.PythonRuntimeCall("init")
+        self.PythonRuntimeCall("init", use_evaluator=False)
 
         self.PythonThreadCondLock = Lock()
         self.PythonThreadCmdCond = Condition(self.PythonThreadCondLock)
@@ -418,7 +421,7 @@
         if self.python_runtime_vars is not None:
             self.PythonThreadCommand("Finish")
             self.PythonThread.join()
-            self.PythonRuntimeCall("cleanup", reverse_order=True)
+            self.PythonRuntimeCall("cleanup", use_evaluator=False, reverse_order=True)
 
         self.python_runtime_vars = None