跳转到主要内容

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 (1.7 kB 查看哈希值)

上传时间: 源代码

支持者:

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面