Add __str__ to Job.

This commit is contained in:
Vincent Driessen 2011-11-21 14:10:15 +01:00
parent fd3831f8f2
commit cc8f05b3c6
1 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,13 @@ class Job(object):
"""
return self.func(*self.args, **self.kwargs)
def __str__(self):
return '<Job %s(%s, %s)>' % (
self.func.__name__,
', '.join(
map(repr, self.args) +
map(lambda key, val: '%s=%r' % (key, val), self.kwargs.items())))
@total_ordering
class Queue(object):