interface PyNodeBase : SALOME::GenericObj
{
+ /*!
+ This method allows to define a new global var called \a varName. This newly created var will be
+ set to value \a valueOfVar.
+ */
+ void defineNewCustomVar(in string varName, in pickledArgs valueOfVar) raises (SALOME::SALOME_Exception);
+
/*!
This methode executes the python code in \a codeStr and can append/remove symboles in context to make them available or not for future call of execute on this.
\param [in] codeStr - the python code (without statement) to be executed, that can modify the context initialized at initialization.
self.context["my_container"] = self.my_container
exec ccode in self.context
+ def defineNewCustomVar(self,varName,valueOfVar):
+ self.context[varName] = cPickle.loads(valueOfVar)
+ pass
+
def executeAnotherPieceOfCode(self,code):
"""Called for initialization of container lodging self."""
try:
self.context={}
self.context["my_container"] = self.my_container
+ def defineNewCustomVar(self,varName,valueOfVar):
+ self.context[varName] = cPickle.loads(valueOfVar)
+ pass
+
def executeAnotherPieceOfCode(self,code):
"""Called for initialization of container lodging self."""
try: