Permalink
Browse files

Cosmetics

  • Loading branch information...
1 parent 929405e commit e6c19ad57f4272038f69553e380d493a0b1caadb @ask committed May 17, 2012
View
@@ -145,6 +145,7 @@ def __init__(self, channel=None, exchange=None, *args, **kwargs):
if not isinstance(exchange, Exchange):
exchange = Exchange(exchange,
kwargs.get("exchange_type") or self.exchange_type)
+ self.queues = self.app.amqp.queues # shortcut
super(TaskProducer, self).__init__(channel, exchange, *args, **kwargs)
def delay_task(self, task_name, task_args=None, task_kwargs=None,
@@ -190,14 +191,12 @@ def delay_task(self, task_name, task_args=None, task_kwargs=None,
if chord:
body["chord"] = chord
- print("KWARGS: %r" % (kwargs, ))
-
self.publish(body, exchange=exchange, mandatory=mandatory,
immediate=immediate, routing_key=routing_key,
serializer=serializer or self.serializer,
compression=compression or self.compression,
retry=retry, retry_policy=_rp, delivery_mode=delivery_mode,
- declare=[self.app.amqp.queues[queue]] if queue else [],
+ declare=[self.queues[queue]] if queue else [],
**kwargs)
signals.task_sent.send(sender=task_name, **body)
View
@@ -144,7 +144,7 @@ def wait_for(self, task_id, timeout=None, propagate=True, interval=0.5):
time_elapsed = 0.0
- while True:
+ while 1:
status = self.get_status(task_id)
if status == states.SUCCESS:
return self.get_result(task_id)
@@ -79,7 +79,7 @@ def get_processtree_pids(pid, include_parent=True):
parents = get_all_processes_pids()
all_pids = parents.keys()
pids = set([pid])
- while True:
+ while 1:
pids_new = pids.copy()
for _pid in all_pids:
@@ -223,7 +223,7 @@ def readline(self, x, y):
curses.echo()
try:
i = 0
- while True:
+ while 1:
ch = self.win.getch(x, y + i)
if ch != -1:
if ch in (10, curses.KEY_ENTER): # enter
View
@@ -339,7 +339,7 @@ def day_out_of_range(year, month, day):
return False
def roll_over():
- while True:
+ while 1:
flag = (datedata.dom == len(days_of_month) or
day_out_of_range(datedata.year,
months_of_year[datedata.moy],
@@ -424,7 +424,6 @@ def _eventloop(self):
else:
sleep(min(time_to_sleep, 1))
-
def on_task(self, task):
"""Handle received task.

0 comments on commit e6c19ad

Please sign in to comment.