Ask Solem 12 yıl önce
ebeveyn
işleme
8709038581
3 değiştirilmiş dosya ile 13 ekleme ve 13 silme
  1. 6 6
      celery/__init__.py
  2. 5 5
      celery/events/state.py
  3. 2 2
      celery/task/__init__.py

+ 6 - 6
celery/__init__.py

@@ -45,14 +45,14 @@ if STATICA_HACK:
     # This is never executed, but tricks static analyzers (PyDev, PyCharm,
     # pylint, etc.) into knowing the types of these symbols, and what
     # they contain.
-    from celery.app.base import Celery
-    from celery.app.utils import bugreport
-    from celery.app.task import Task
-    from celery._state import current_app, current_task
-    from celery.canvas import (
+    from celery.app.base import Celery                  # noqa
+    from celery.app.utils import bugreport              # noqa
+    from celery.app.task import Task                    # noqa
+    from celery._state import current_app, current_task # noqa
+    from celery.canvas import (                         # noqa
         chain, chord, chunks, group, subtask, xmap, xstarmap,
     )
-    from celery.utils import uuid
+    from celery.utils import uuid                       # noqa
 
 # Lazy loading
 from .__compat__ import recreate_module

+ 5 - 5
celery/events/state.py

@@ -331,9 +331,9 @@ class State(object):
         Returns a list of `(uuid, task)` tuples.
 
         """
-        sorted_tasks = self._sort_tasks_by_time([(uuid, task)
-                                                 for uuid, task in self.tasks.iteritems()
-                                                 if task.name == name])
+        sorted_tasks = self._sort_tasks_by_time((uuid, task)
+                for uuid, task in self.tasks.iteritems()
+                    if task.name == name)
 
         return sorted_tasks[0:limit or None]
 
@@ -343,9 +343,9 @@ class State(object):
         Returns a list of `(uuid, task)` tuples.
 
         """
-        return self._sort_tasks_by_time([(uuid, task)
+        return self._sort_tasks_by_time((uuid, task)
                 for uuid, task in self.itertasks(limit)
-                    if task.worker.hostname == hostname])
+                    if task.worker.hostname == hostname)
 
     def task_types(self):
         """Returns a list of all seen task types."""

+ 2 - 2
celery/task/__init__.py

@@ -27,7 +27,7 @@ if STATICA_HACK:
     # This is never executed, but tricks static analyzers (PyDev, PyCharm,
     # pylint, etc.) into knowing the types of these symbols, and what
     # they contain.
-    from celery.canvas import chain, group, chord, subtask
+    from celery.canvas import group, chord, subtask
     from .base import BaseTask, Task, PeriodicTask, task, periodic_task
     from .sets import TaskSet
 
@@ -42,7 +42,7 @@ old_module, new_module = recreate_module(__name__,  # pragma: no cover
     by_module={
         'celery.task.base':   ['BaseTask', 'Task', 'PeriodicTask',
                                'task', 'periodic_task'],
-        'celery.canvas':      ['chain', 'group', 'chord', 'subtask'],
+        'celery.canvas':      ['group', 'chord', 'subtask'],
         'celery.task.sets':   ['TaskSet'],
     },
     base=module,