允许doit读取使用类、修饰函数或函数调用定义的任务。
letsdoit的Python项目详细描述
让doit读取使用类、修饰函数或函数定义的任务 电话。
dodo.py文件示例:
from letsdoit import TaskBase, task # Define a task using a decorator. @task(file_dep=['dodo.py']) def simple(): print "hi" # By calling a function. compile = task(actions=['cc -c main.c'], file_dep=["main.c", "defs.h"], targets=['main.o'], ) # A class with a run() method class hello(TaskBase): """Hello from Python.""" targets = ['hello.txt'] def run(self): with open(self.targets[0], "a") as output: output.write("Hello world.") # A class with a list of actions. class checker(TaskBase): """Run pyflakes.""" actions = ['pyflakes letsdoit.py'] file_dep = ['letsdoit.py']