From dc4e77017e785af3efd0c39e5edb6c07f9c4ab1e Mon Sep 17 00:00:00 2001 From: Sandy Walsh <sandy@sandywalsh.com> Date: Sun, 12 Feb 2012 12:50:40 -0800 Subject: [PATCH] pep8 --- worker.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/worker.py b/worker.py index d2c1956..1ca02c3 100644 --- a/worker.py +++ b/worker.py @@ -18,9 +18,10 @@ scheduler_exchange = kombu.entity.Exchange("scheduler_fanout", type="fanout", scheduler_queues = [ # The Queue name has to be unique or we we'll end up with Round Robin - # behavior from Rabbit, even though it's a Fanout queue. In Nova the queues - # have UUID's tacked on the end. - kombu.Queue("scheduler.xxx", scheduler_exchange, durable=False, auto_delete=False), + # behavior from Rabbit, even though it's a Fanout queue. In Nova the + # queues have UUID's tacked on the end. + kombu.Queue("scheduler.xxx", scheduler_exchange, durable=False, + auto_delete=False), ] nova_exchange = kombu.entity.Exchange("nova", type="topic", @@ -44,7 +45,8 @@ class SchedulerFanoutConsumer(kombu.mixins.ConsumerMixin): self.connection = connection def get_consumers(self, Consumer, channel): - return [Consumer(queues=scheduler_queues, callbacks=[self.on_scheduler]), + return [Consumer(queues=scheduler_queues, + callbacks=[self.on_scheduler]), Consumer(queues=nova_queues, callbacks=[self.on_nova])] def _process(self, body, message): @@ -58,7 +60,7 @@ class SchedulerFanoutConsumer(kombu.mixins.ConsumerMixin): req = urllib2.Request(url, cooked_data) response = urllib2.urlopen(req) page = response.read() - print "sent", page + print page except urllib2.HTTPError, e: print e page = e.read() @@ -82,8 +84,8 @@ if __name__ == "__main__": virtual_host=RABBIT_VIRTUAL_HOST) with kombu.connection.BrokerConnection(**params) as conn: - consumer = SchedulerFanoutConsumer(conn) - try: - consumer.run() - except KeyboardInterrupt: - print("bye bye") + consumer = SchedulerFanoutConsumer(conn) + try: + consumer.run() + except KeyboardInterrupt: + print("bye bye")