fhcrc/nestly — pull request #14 by cmccoy (2013-04-12 23:30:22+00:00)
Title: nestly.scons: pass construction environment to decorated functions

It'd make things a little easier if each decorated function was given a clone of a base SCons environment, populated with variables from the nest. This would simplify functions.

```python
nest.add('level', (1, 2, 3))
```

```python
@w.add_target()
def run_at_level(outdir, c):
level = c['level']
return env.Command('output_{0}.txt'.format(level),
'input.txt',
'in2out --level={0} < $SOURCE > $TARGET'.format(level))
```

Becomes:

```python
@w.add_target()
def run_at_level(env, outdir, c):
return env.Command('output_${level}.txt',
'input.txt',
'in2out --level=$level < $SOURCE > $TARGET')
```