@PHXClassDecorator(PHXTException_Decorator)
class PHXScriptWrapperObject
This object is passed to scriptWrapper scripts and provides the “wrapper” global object which provides runtime services for the wrapper.def __init__(self, varName)
@param varName: the name of the variable already declared in the wrapper to reference@type varName: string@rtype: void
def addMethod(self, methodName, fullName='', downloadInputs=False)
Publicizes a method to our clients.
@param methodName: The name of the method to publicize.@type methodName: string@param fullName: A human readable name to show in GUI programs for this method. For example, ModelCenter will show this in the right-click menu of a component.@type fullName: string@param downloadInputs: Hint passed to the client on whether the inputs should be downloaded after the method is run.@type downloadInputs: boolean@rtype: void
def addVariable(self, varName, varType, isInput)
Adds a variable to this component. Returns a reference to the new variable. Valid types are: boolean, double, long, string, file.
All types except file may be made into arrays by adding [] at the end of the type string.
@param varName: The full name of the new variable. May include group specification with ’.’.@type varName: string@param varType: The type of variable to create. Use the same type strings as for the variable`: statemensts at the top of the ScriptWrapper.@type varType: string@param isInput: If true, the variable will be an input, if false, it will be an output.@type isInput: boolean@rtype: PHXSimpleType
def getDirectory(self)
Returns the directory where this component was loaded from.
@rtype: string
def getRunDirectory(self)
Returns the current “run” directory, which is the same as getDirectory() unless run sharing is being used.
@rtype: string
def getRunShare(self)
Returns the PHXRunShareContext object used for process control and monitoring with this component.
@rtype:PHXRunShareContext
def getVariable(self, varName)
Returns a reference to the named variable.
@param varName: The full name of the variable to retrieve. May include group specification with ’.’.@type varName: string@rtype:PHXSimpleType
def removeVariable(self, varName)
Dynamically removes a variable from this component
@param varName: The full name of the variable to remove. May include group specification with ’.’.@type varName: string@rtype: void
def sleep(self, milliSeconds)
sleeps for a period of time
@param milliSeconds: the amount of time to sleep (in milliseconds).@type milliSeconds: long@rtype: void