Skip to content

Instantly share code, notes, and snippets.

@schettino72
Created January 5, 2015 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schettino72/9868c27526a6c5ea554c to your computer and use it in GitHub Desktop.
Save schettino72/9868c27526a6c5ea554c to your computer and use it in GitHub Desktop.
import glob
from doit.loader import create_after
@create_after(executed='early')
def task_build():
for inf in glob.glob('*.in'):
yield {
'name': inf,
'actions': ['cp %(dependencies)s %(targets)s'],
'file_dep': [inf],
'targets': [inf[:-3] + '.out'],
'clean': True,
}
def task_early():
"""a task that create some files..."""
inter_files = ('a.in', 'b.in', 'c.in')
return {
'actions': ['touch %(targets)s'],
'targets': inter_files,
'clean': True,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment