Eidolon
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Task Class Reference

Inherits object.

Collaboration diagram for Task:
Collaboration graph

Public Member Functions

def __init__ (self, label, func=None, args=(), kwargs={}, selfName=None, parentTask=None)
 
def start (self, useThread=False)
 
def isDone (self)
 
def setLabel (self, label)
 
def getLabel (self)
 
def setProgress (self, curprogress)
 
def setMaxProgress (self, maxprogress)
 
def getProgress (self)
 
def __repr__ (self)
 

Static Public Member Functions

def Null ()
 

Public Attributes

 curprogress
 
 maxprogress
 
 result
 
 completed
 
 started
 
 flushQueue
 
 parentTask
 
 func
 
 args
 
 kwargs
 
 label
 

Detailed Description

This class represents the abstract notion of a task, with a 'curprogress' value to indicate progress in relation to
a 'maxprogress' value. Tasks may have their own threads or be executed by their containers. Normally tasks are
executed by a TaskQueue object. The actual action of the Task object should be implemented by the supplied `func'
argument, which must be a callable accepting the positional and keyword arguments given by `args' and `kwargs'.
When a Task object is executed, it's start() method is called which will call self.func in the calling thread. A 
Task object can have a parent Task, which occurs when the body of one task invokes an operation that normally adds 
a task to a queue. When this occurs the progress and label methods call into the parent Task object.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  label,
  func = None,
  args = (),
  kwargs = {},
  selfName = None,
  parentTask = None 
)

Member Function Documentation

◆ __repr__()

def __repr__ (   self)

◆ getLabel()

def getLabel (   self)
Get the task's label, or that of the parent if present.
Here is the caller graph for this function:

◆ getProgress()

def getProgress (   self)
Returns the current progress value and maximum value, or that of the parent if present, or (0,0) if unknown.

◆ isDone()

def isDone (   self)
Returns True if the task has started and self.complete is True.

◆ Null()

def Null ( )
static

◆ setLabel()

def setLabel (   self,
  label 
)
Set the task's label (or that of the parent if present), this will be used by UI to indicate current task.
Here is the caller graph for this function:

◆ setMaxProgress()

def setMaxProgress (   self,
  maxprogress 
)
Set the max progress value of this or the parent task to the integer value `maxprogress'.

◆ setProgress()

def setProgress (   self,
  curprogress 
)
Set the progress of this or the parent task to the integer value `curprogress'.

◆ start()

def start (   self,
  useThread = False 
)
Perform the execution of the task. This will set the label, set self.started to True, and then set self.result to
the result of calling self.func with self.args and self.kwargs as arguments. Finally self.complete is set to True 
once this is done.
Here is the call graph for this function:

Member Data Documentation

◆ args

args

◆ completed

completed

◆ curprogress

curprogress

◆ flushQueue

flushQueue

◆ func

func

◆ kwargs

kwargs

◆ label

label

◆ maxprogress

maxprogress

◆ parentTask

parentTask

◆ result

result

◆ started

started

The documentation for this class was generated from the following file: