bioscons icon indicating copy to clipboard operation
bioscons copied to clipboard

Targets init does not work as advertized in docstring

Open metasoarous opened this issue 11 years ago • 0 comments

Specifically,

targs = Targets(locals().values())
targs.show_extras("outdir")

fails with the following trace:

╰➤  sc output
scons: Reading SConscript files ...
AttributeError: 'Targets' object has no attribute 'targets':
  File "/home/csmall/code/slurm-scons-debug/SConstruct", line 53:
    tgts = fileutils.Targets(locals().values())
  File "/home/csmall/pythedge/local/lib/python2.7/site-packages/bioscons/fileutils.py", line 58:
    self.targets = self.update(objs) if objs else set()
  File "/home/csmall/pythedge/local/lib/python2.7/site-packages/bioscons/fileutils.py", line 68:
    self.targets.update(

The following code however works

tgts = fileutils.Targets()
tgts.update(locals().values())
tgts.show_extras(outdir)

It seems that for update to run successfully, there must already be a targets attribute.

metasoarous avatar Feb 19 '14 22:02 metasoarous