From 2838493074120eeb1c7f82aa8987464b9ebcb56d Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 8 Apr 2020 10:41:39 +0200 Subject: [PATCH] Some useful methods for remote access of PyScriptNode --- idl/SALOME_PyNode.idl | 7 +++++++ src/Container/SALOME_PyNode.py | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/idl/SALOME_PyNode.idl b/idl/SALOME_PyNode.idl index 2e017f9c6..efdb6d855 100644 --- a/idl/SALOME_PyNode.idl +++ b/idl/SALOME_PyNode.idl @@ -37,9 +37,16 @@ module Engines { typedef sequence pickledArgs; typedef sequence listofstring; + interface Container; interface PyNodeBase : SALOME::GenericObj { + Container getContainer(); + + string getCode(); + + string getName(); + /*! This method allows to define a new global var called \a varName. This newly created var will be set to value \a valueOfVar. diff --git a/src/Container/SALOME_PyNode.py b/src/Container/SALOME_PyNode.py index fec7107ae..dee1f1896 100644 --- a/src/Container/SALOME_PyNode.py +++ b/src/Container/SALOME_PyNode.py @@ -68,6 +68,15 @@ class PyNode_i (Engines__POA.PyNode,Generic): self.context["my_container"] = self.my_container exec(ccode, self.context) + def getContainer(self): + return self.my_container + + def getCode(self): + return self.code + + def getName(self): + return self.nodeName + def defineNewCustomVar(self,varName,valueOfVar): self.context[varName] = pickle.loads(valueOfVar) pass @@ -106,6 +115,15 @@ class PyScriptNode_i (Engines__POA.PyScriptNode,Generic): self.context={} self.context["my_container"] = self.my_container + def getContainer(self): + return self.my_container + + def getCode(self): + return self.code + + def getName(self): + return self.nodeName + def defineNewCustomVar(self,varName,valueOfVar): self.context[varName] = pickle.loads(valueOfVar) pass -- 2.39.2