SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions
spr_pylib.train.task.PyTask Class Reference

Defines a task that calls a python function. More...

+ Inheritance diagram for spr_pylib.train.task.PyTask:
+ Collaboration diagram for spr_pylib.train.task.PyTask:

Public Member Functions

def __init__
 Constructor. More...
 
def __str__
 Returns a string representation of the task. More...
 
def run
 Execute the task. More...
 
def scanForResources
 Scans for resources needed by this task. More...
 
def postScan
 Hook for tasks that want to do some extra flagging of resources, eg marking versions as deleted. More...
 
- Public Member Functions inherited from spr_pylib.train.task.Task
def __init__
 Constructor. More...
 
def setCompleted
 
def isCompleted
 
def getName
 Return the name of this task. More...
 
def setName
 Set the name of this task. More...
 
def scanForResources
 Abstract method. More...
 
def checkResourcesAvailable
 Checks if all the resources needed to run this task are available. More...
 
def markResourcesAvailable
 Mark all resources used by this task as available. More...
 
def run
 Abstract method. More...
 
def canRunRemote
 Indicates if this task can be run remotely. More...
 
def __str__
 Returns a string representation of the task. More...
 

Detailed Description

Defines a task that calls a python function.

Constructor & Destructor Documentation

def spr_pylib.train.task.PyTask.__init__ (   self,
  in_fnames,
  out_fnames,
  func,
  arg,
  kwarg 
)

Constructor.

Parameters
selfThe callee object.
in_fnamesA list of file names that will be used as inputs for the task.
out_fnamesA list of file names that will be used as outputs for the task.
funcThe function to be called.
*argThe positional arguments for the function call.
**kwargThe keyword arguments for the function call.

Member Function Documentation

def spr_pylib.train.task.PyTask.__str__ (   self)

Returns a string representation of the task.

Returns
A string showing the name of the function and all its arguments.
def spr_pylib.train.task.PyTask.run (   self,
  host = None 
)

Execute the task.

No remote execution supported for now.

Returns
The return value of the function call.
def spr_pylib.train.task.PyTask.scanForResources (   self,
  resource_list 
)

Scans for resources needed by this task.

Parameters
selfThe callee object.
resource_listThe resource list with all registered resources.
def spr_pylib.train.task.PyTask.postScan (   self)

Hook for tasks that want to do some extra flagging of resources, eg marking versions as deleted.