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

Defines the base class of all tasks. More...

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

Public Member Functions

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 the base class of all tasks.

Constructor & Destructor Documentation

def spr_pylib.train.task.Task.__init__ (   self)

Constructor.

Parameters
selfThe callee object.

Member Function Documentation

def spr_pylib.train.task.Task.setCompleted (   self,
  completed = True 
)
def spr_pylib.train.task.Task.isCompleted (   self)
def spr_pylib.train.task.Task.getName (   self)

Return the name of this task.

Parameters
selfThe callee object.
def spr_pylib.train.task.Task.setName (   self,
  name 
)

Set the name of this task.

Parameters
selfThe callee object.
nameThe new name of the task.
def spr_pylib.train.task.Task.scanForResources (   self,
  resource_list 
)

Abstract method.

Checks resource usage of the task.

Checks if this task uses resources already defined in resource_list . If a resource is already defined, update it to indicate that this task is another consumer. If not defined, create and register the new resource.

Parameters
selfThe callee object.
resource_listThe resource list holding all registered resources. Will be updated when needed.
def spr_pylib.train.task.Task.checkResourcesAvailable (   self)

Checks if all the resources needed to run this task are available.

Returns
True if all resources are available.
Parameters
selfThe callee object.
def spr_pylib.train.task.Task.markResourcesAvailable (   self)

Mark all resources used by this task as available.

Parameters
selfThe callee object.
def spr_pylib.train.task.Task.run (   self,
  host = None 
)

Abstract method.

Execute the task.

Parameters
selfThe callee object.
hostAn optional host name. If given, an atempt will be made to run the task remotely.
def spr_pylib.train.task.Task.canRunRemote (   self)

Indicates if this task can be run remotely.

Returns
True if the task can be run remotely.
Parameters
selfThe callee object.
def spr_pylib.train.task.Task.__str__ (   self)

Returns a string representation of the task.

Returns
This is the same as getName() .
Parameters
selfThe callee object.