Skip to main content

Lets doit read tasks defined using classes, decorated functions or function calls.

Project description

Lets doit read tasks defined using classes, decorated functions or function calls.

A sample dodo.py file:

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']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

letsdoit-0.1.1.tar.gz (1.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page