From aba52c28a330911614d2c6853b63f07ea03fc440 Mon Sep 17 00:00:00 2001 From: James Turk Date: Tue, 15 May 2012 16:54:33 -0400 Subject: [PATCH] __import__ task for --sample --- oyster/scripts/signal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oyster/scripts/signal.py b/oyster/scripts/signal.py index 784070c..d5b5c18 100644 --- a/oyster/scripts/signal.py +++ b/oyster/scripts/signal.py @@ -25,7 +25,8 @@ def main(): if args.sample: print 'sampling 100 documents' docs = docs.limit(100) - task = current_app.tasks[name] + module, name = args.task.rsplit('.', 1) + task = getattr(__import__(module, fromlist=[name]), name) for doc in docs: task.apply((doc['_id'],))