#!/usr/bin/env python
import argparse
from celery.execute import send_task

from oyster.core import kernel

def main():
    parser = argparse.ArgumentParser(
        description='do a task for all documents in a doc_class',
    )

    parser.add_argument('task', type=str, help='task name to apply')
    parser.add_argument('doc_class', type=str,
                        help='doc_class to apply function to')

    args = parser.parse_args()

    docs = kernel.db.tracked.find({'doc_class': args.doc_class}, timeout=False)
    print '%s docs in %s' % (docs.count(), args.doc_class)

    for doc in docs:
        send_task(args.task, doc['_id'])

if __name__ == '__main__':
    main()

@@ -626,16 +626,17 @@
 s.task, 
+(
 doc%5B'_id
@@ -637,16 +637,19 @@
 c%5B'_id'%5D
+, )
 )%0A%0Aif __

fix signal x2