Package wafadmin :: Module Task :: Class TaskBase
[hide private]
[frames] | no frames]

Class TaskBase

source code

object --+
         |
        TaskBase

Base class for all Waf tasks

The most important methods are (by usual order of call): 1 runnable_status: ask the task if it should be run, skipped, or if we have to ask later 2 __str__: string to display to the user 3 run: execute the task 4 post_run: after the task is run, update the cache about the task

This class should be seen as an interface, it provides the very minimum necessary for the scheduler so it does not do much.

For illustration purposes, TaskBase instances try to execute self.fun (if provided)

Nested Classes [hide private]
  __metaclass__
store the task types that have a name ending in _task into a map (remember the existing task types)
Instance Methods [hide private]
 
__init__(self, normal=1)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__repr__(self)
used for debugging
source code
 
__str__(self)
string to display to the user
source code
 
runnable_status(self)
RUN_ME SKIP_ME or ASK_LATER
source code
 
can_retrieve_cache(self) source code
 
call_run(self) source code
 
run(self)
called if the task must run
source code
 
post_run(self)
update the dependency tree (node stats)
source code
 
display(self)
print either the description (using __str__) or the progress bar or the ide output
source code
 
attr(self, att, default=None)
retrieve an attribute from the instance or from the class
source code
 
hash_constraints(self)
identify a task type for all the constraints relevant for the scheduler: precedence, file production
source code
 
format_error(self)
error message to display to the user (when a build fails)
source code
 
install(self)
installation is performed by looking at the task attributes: * install_path: installation path like "${PREFIX}/bin" * filename: install the first node in the outputs as a file with a particular name, be certain to give os.sep * chmod: permissions
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Variables [hide private]
  color = "GREEN"
  maxjobs = sys.maxint
  classes = {}
  stat = None
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, normal=1)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

used for debugging

Overrides: object.__repr__

__str__(self)
(Informal representation operator)

source code 

string to display to the user

Overrides: object.__str__