Lets doit可以读取使用类、装饰函数或函数调用定义的任务。
项目描述
Lets 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']
项目详情
关闭
letsdoit-0.1.1.tar.gz的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 5d4a103933c17bbb334fda60cdbecd8d359022c08f5ec303d6359288cc5f5132 |
|
| MD5 | cff8bb14e7d2e8d5c6137668df0aa045 |
|
| BLAKE2b-256 | e54720ecd61ea0952628b1308a426eedacbfe7a9bc3ffa15863d0ab9d8fd5313 |