SPRAAK
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__ (self)
 Constructor. More...
 
def setCompleted (self, completed=True)
 
def isCompleted (self)
 
def getName (self)
 Return the name of this task. More...
 
def setName (self, name)
 Set the name of this task. More...
 
def scanForResources (self, resource_list)
 Abstract method. More...
 
def checkResourcesAvailable (self)
 Checks if all the resources needed to run this task are available. More...
 
def markResourcesAvailable (self)
 Mark all resources used by this task as available. More...
 
def run (self, host=None)
 Abstract method. More...
 
def canRunRemote (self)
 Indicates if this task can be run remotely. More...
 
def __str__ (self)
 Returns a string representation of the task. More...
 

Detailed Description

Defines the base class of all tasks.

Constructor & Destructor Documentation

§ __init__()

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

Constructor.

Parameters
selfThe callee object.

Member Function Documentation

§ setCompleted()

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

§ isCompleted()

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

§ getName()

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

Return the name of this task.

Parameters
selfThe callee object.

§ setName()

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.

§ scanForResources()

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.

§ checkResourcesAvailable()

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.

§ markResourcesAvailable()

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

Mark all resources used by this task as available.

Parameters
selfThe callee object.

§ run()

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.

§ canRunRemote()

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.

§ __str__()

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.