Package wafadmin :: Module TaskGen :: Class task_gen
[hide private]
[frames] | no frames]

Class task_gen

source code

object --+
         |
        task_gen

Most methods are of the form 'def meth(self):' without any parameters there are many of them, and they do many different things: * task creation * task results installation * environment modification * attribute addition/removal

The inheritance approach is complicated * mixing several languages at once * subclassing is needed even for small changes * inserting new methods is complicated

This new class uses a configuration table: * adding new methods easily * obtaining the order in which to call the methods * postponing the method calls (post() -> apply)

Additionally, a 'traits' static attribute is provided: * this list contains methods * the methods can remove or add methods from self.meths Example1: the attribute 'staticlib' is set on an instance a method set in the list of traits is executed when the instance is posted, it finds that flag and adds another method for execution Example2: a method set in the list of traits finds the msvc compiler (from self.env['MSVC']==1); more methods are added to self.meths

Nested Classes [hide private]
  __metaclass__
no decorators for classes, so we use a metaclass we store into task_gen.classes the classes that inherit task_gen and whose names end in '_taskgen'
Instance Methods [hide private]
 
__init__(self, *kw, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
str(x)
source code
 
__setattr__(self, name, attr)
x.__setattr__('name', value) <==> x.name = value
source code
 
to_list(self, value)
helper: returns a list
source code
 
apply_core(self) source code
 
apply(self)
order the methods to execute using self.prec or task_gen.prec
source code
 
post(self)
runs the code to create the tasks, do not subclass
source code
 
get_hook(self, ext) source code
 
create_task(self, name, env=None) source code
 
find_sources_in_dirs(self, dirnames, excludes=[], exts=[])
subclass if necessary
source code
 
clone(self, env) source code
 
get_inst_path(self)
return a default parameter if provided
source code
 
set_inst_path(self, val) source code

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

Class Variables [hide private]
  mappings = {}
  mapped = {}
  traits = {}
  classes = {}
  idx = {}
  install_path = property(get_inst_path, set_inst_path)
Instance Variables [hide private]
  prec
map precedence of function names to call
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *kw, **kwargs)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__setattr__(self, name, attr)

source code 

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__
(inherited documentation)