Bläddra i källkod

celeryctl shell: chord, TaskSet/group and BaseTask is now in locals

Ask Solem 13 år sedan
förälder
incheckning
dfe19415e6
1 ändrade filer med 6 tillägg och 1 borttagningar
  1. 6 1
      celery/bin/celeryctl.py

+ 6 - 1
celery/bin/celeryctl.py

@@ -392,8 +392,13 @@ class shell(Command):
             import_module("celery.concurrency.eventlet")
             import_module("celery.concurrency.eventlet")
         if gevent:
         if gevent:
             import_module("celery.concurrency.gevent")
             import_module("celery.concurrency.gevent")
+        from .. import task
         self.app.loader.import_default_modules()
         self.app.loader.import_default_modules()
-        self.locals = {"celery": self.app}
+        self.locals = {"celery": self.app,
+                       "BaseTask": task.BaseTask,
+                       "TaskSet": task.TaskSet,
+                       "chord": task.chord,
+                       "group": task.group}
 
 
         if not without_tasks:
         if not without_tasks:
             self.locals.update(dict((task.__name__, task)
             self.locals.update(dict((task.__name__, task)