Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Simple library for making tasks out of python methods

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 task
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 example_longfail.py
Octocat-spinner-32 example_unstable.py
Octocat-spinner-32 setup.py
README.md

task.py

Happy python library for keeping track of tasks and rerunning them. Creating and running a task is easy:

import task

@task.ify()
def doit(**kwargs):
     print kwargs['task_id']

task.setup_db('sqlite://') # in memory db
task_id = doit()
task.run(task_id)

The wrapped method needs to accept **kwargs. It will be passed two kwargs: task_id and progress. Task_id holds the identifier for the task should you need it. Progress holds the last data you returned from the method.

The sexy way to use tasks is to define a generator that yields for each phase of the task. See the tests and example_* for examples of running tasks. If you have nose installed you can run the tests via nosetests.

Something went wrong with that request. Please try again.