Version: 9.12.0
Engines::PyScriptNode Interface Reference

import"SALOME_PyNode.idl";

Inheritance diagram for Engines::PyScriptNode:

Public Member Functions

void assignNewCompiledCode (in string codeStr) raises (SALOME::SALOME_Exception)
 This method compiles, but NOT EXECUTE, the code codeStr. More...
 
pickledArgs execute (in listofstring outargsname, in pickledArgs inargs) raises (SALOME::SALOME_Exception)
 execute a python script defined in the node More...
 
void executeSimple (in listofstring key, in listofstring val) raises (SALOME::SALOME_Exception)
 
void executeFirst (in SALOME::SenderByte inargs) raises (SALOME::SALOME_Exception)
 first part of whole execute method. More...
 
SALOME::SenderByteSeq executeSecond (in listofstring outargsname) raises (SALOME::SALOME_Exception)
 second and last part of execute method. More...
 
pickledArgs getValueOfVarInContext (in string varName) raises (SALOME::SALOME_Exception)
 
void assignVarInContext (in string varName, in pickledArgs value) raises (SALOME::SALOME_Exception)
 
pickledArgs callMethodOnVarInContext (in string varName, in string methodName, in pickledArgs args) raises (SALOME::SALOME_Exception)
 
listofstring listAllVarsInContext () raises (SALOME::SALOME_Exception)
 
void removeAllVarsInContext () raises (SALOME::SALOME_Exception)
 
Container getContainer ()
 
string getCode ()
 
string getName ()
 
void defineNewCustomVar (in string varName, in pickledArgs valueOfVar) raises (SALOME::SALOME_Exception)
 This method allows to define a new global var called varName. More...
 
void executeAnotherPieceOfCode (in string codeStr) raises (SALOME::SALOME_Exception)
 This method executes the python code in codeStr and can append/remove symboles in context to make them available or not for future call of execute on this. More...
 
void Register ()
 Increase the reference count (mark as used by another object). More...
 
void UnRegister ()
 Decrease the reference count (release by another object). More...
 
void Destroy ()
 Obsolete, left for compatibility reasons only. More...
 

Member Function Documentation

◆ assignNewCompiledCode()

void Engines::PyScriptNode::assignNewCompiledCode ( in string  codeStr)
raises (SALOME::SALOME_Exception
)

This method compiles, but NOT EXECUTE, the code codeStr.

The result of the compiled code will be used then on execute step.

Parameters
codeStr- the python code (without statement) to be executed, that can modify the context initialized at initialization.

◆ assignVarInContext()

void Engines::PyScriptNode::assignVarInContext ( in string  varName,
in pickledArgs  value 
)
raises (SALOME::SALOME_Exception
)

◆ callMethodOnVarInContext()

pickledArgs Engines::PyScriptNode::callMethodOnVarInContext ( in string  varName,
in string  methodName,
in pickledArgs  args 
)
raises (SALOME::SALOME_Exception
)

◆ defineNewCustomVar()

void Engines::PyNodeBase::defineNewCustomVar ( in string  varName,
in pickledArgs  valueOfVar 
)
raises (SALOME::SALOME_Exception
)
inherited

This method allows to define a new global var called varName.

This newly created var will be set to value valueOfVar.

◆ Destroy()

void SALOME::GenericObj::Destroy ( )
inherited

Obsolete, left for compatibility reasons only.

Use UnRegister() instead.

◆ execute()

pickledArgs Engines::PyScriptNode::execute ( in listofstring  outargsname,
in pickledArgs  inargs 
)
raises (SALOME::SALOME_Exception
)

execute a python script defined in the node

Parameters
outargsnameoutput argument names
inargsinput argument values (dict) provided as a python pickle
Returns
output argument values (tuple) as a python pickle

Referenced by KERNEL_PY.salome_pynode.SmartPyNode::__getattr__().

◆ executeAnotherPieceOfCode()

void Engines::PyNodeBase::executeAnotherPieceOfCode ( in string  codeStr)
raises (SALOME::SALOME_Exception
)
inherited

This method executes the python code in codeStr and can append/remove symboles in context to make them available or not for future call of execute on this.

Parameters
[in]codeStr- the python code (without statement) to be executed, that can modify the context initialized at initialization.

◆ executeFirst()

void Engines::PyScriptNode::executeFirst ( in SALOME::SenderByte  inargs)
raises (SALOME::SALOME_Exception
)

first part of whole execute method.

This split is to reduce the memory peak.

◆ executeSecond()

SALOME::SenderByteSeq Engines::PyScriptNode::executeSecond ( in listofstring  outargsname)
raises (SALOME::SALOME_Exception
)

second and last part of execute method.

This split is to reduce the memory peak.

◆ executeSimple()

void Engines::PyScriptNode::executeSimple ( in listofstring  key,
in listofstring  val 
)
raises (SALOME::SALOME_Exception
)

◆ getCode()

string Engines::PyNodeBase::getCode ( )
inherited

◆ getContainer()

◆ getName()

string Engines::PyNodeBase::getName ( )
inherited

◆ getValueOfVarInContext()

pickledArgs Engines::PyScriptNode::getValueOfVarInContext ( in string  varName)
raises (SALOME::SALOME_Exception
)

◆ listAllVarsInContext()

listofstring Engines::PyScriptNode::listAllVarsInContext ( )
raises (SALOME::SALOME_Exception
)

◆ Register()

void SALOME::GenericObj::Register ( )
inherited

Increase the reference count (mark as used by another object).

◆ removeAllVarsInContext()

void Engines::PyScriptNode::removeAllVarsInContext ( )
raises (SALOME::SALOME_Exception
)

◆ UnRegister()

void SALOME::GenericObj::UnRegister ( )
inherited

Decrease the reference count (release by another object).

Referenced by SALOME_PyNode.Generic::Destroy().