From: Anthony Geay Date: Wed, 8 Apr 2020 08:41:39 +0000 (+0200) Subject: Some useful methods for remote access of PyScriptNode X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2838493074120eeb1c7f82aa8987464b9ebcb56d;p=modules%2Fkernel.git Some useful methods for remote access of PyScriptNode --- 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