Commits

Ronny Pfannschmidt committed e6f46aa

move signals to kij.util for now

  • Participants
  • Parent commits 9ce7805

Comments (0)

Files changed (5)

File kij/task_queue.py

-from kij.tasks.util import task_failed
-from kij.tasks.util import task_succeeded
-
+from kij.util import signal
+task_failed = signal('task_failed')
+task_succeeded = signal('task_succeeded')
+task_finished = signal('task_finished')
 
 
 class Queue(object):

File kij/tasks/metadata.py

-from .util import TaskBase, task_succeeded
+from .util import TaskBase
 from kij.files.dist import DistFile
 
 

File kij/tasks/util.py

 """
 
 from collections import deque
-from blinker import Namespace
 
-ns = Namespace()
-task_failed = ns.signal('task_failed')
-task_succeeded = ns.signal('task_succeeded')
-task_finished = ns.signal('task_finished')
 
 
 class TaskBase(object):
+from blinker import Namespace
+namespace = Namespace()
+
+
+def signal(name):
+    return namespace.signal(name)
+
+task_succeeded = signal('task_succeeded')
+task_failed = signal('task_failed')

File tests/tasks/test_util.py

 import py
-from kij.tasks.util import TaskBase, task_succeeded, task_failed
+from kij.tasks.util import TaskBase
+from kij.util import task_succeeded, task_failed
 from kij.task_queue import Queue