summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAsk Solem <ask@celeryproject.org>2011-09-22 17:10:13 +0100
committerAsk Solem <ask@celeryproject.org>2011-09-22 17:10:13 +0100
commitc0383c88f535161d02e528227b8d60b62e1ffe32 (patch)
tree12b1d57961739a73580611a442d5d04a0285bbb1 /examples
parent20ec760e101ea27fb457e4394ce60db47468c054 (diff)
downloadkombu-c0383c88f535161d02e528227b8d60b62e1ffe32.tar.gz
PEP8ify + pyflakesv1.4.0
Diffstat (limited to 'examples')
-rw-r--r--examples/simple_task_queue/client.py3
-rw-r--r--examples/simple_task_queue/queues.py1
-rw-r--r--examples/simple_task_queue/tasks.py2
-rw-r--r--examples/simple_task_queue/worker.py4
4 files changed, 3 insertions, 7 deletions
diff --git a/examples/simple_task_queue/client.py b/examples/simple_task_queue/client.py
index 489aa2e6..edf63f76 100644
--- a/examples/simple_task_queue/client.py
+++ b/examples/simple_task_queue/client.py
@@ -9,6 +9,7 @@ priority_to_routing_key = {"high": "hipri",
"mid": "midpri",
"low": "lopri"}
+
def send_as_task(connection, fun, args, kwargs, priority="mid"):
payload = {"fun": fun, "args": args, "kwargs": kwargs}
routing_key = priority_to_routing_key[priority]
@@ -23,6 +24,6 @@ if __name__ == "__main__":
from kombu import BrokerConnection
from .tasks import hello_task
- conection = BrokerConnection("amqp://guest:guest@localhost:5672//")
+ connection = BrokerConnection("amqp://guest:guest@localhost:5672//")
send_as_task(connection, fun=hello_task, args=("Kombu", ),
priority="high")
diff --git a/examples/simple_task_queue/queues.py b/examples/simple_task_queue/queues.py
index 5f1feef2..680e7575 100644
--- a/examples/simple_task_queue/queues.py
+++ b/examples/simple_task_queue/queues.py
@@ -4,4 +4,3 @@ task_exchange = Exchange("tasks", type="direct")
task_queues = [Queue("hipri", task_exchange, routing_key="hipri"),
Queue("midpri", task_exchange, routing_key="midpri"),
Queue("lopri", task_exchange, routing_key="lopri")]
-
diff --git a/examples/simple_task_queue/tasks.py b/examples/simple_task_queue/tasks.py
index 47146e45..f6e9da03 100644
--- a/examples/simple_task_queue/tasks.py
+++ b/examples/simple_task_queue/tasks.py
@@ -1,4 +1,2 @@
def hello_task(who="world"):
print("Hello %s" % (who, ))
-
-
diff --git a/examples/simple_task_queue/worker.py b/examples/simple_task_queue/worker.py
index 68e7d6b6..fb9e9a7c 100644
--- a/examples/simple_task_queue/worker.py
+++ b/examples/simple_task_queue/worker.py
@@ -1,11 +1,11 @@
from __future__ import with_statement
-from kombu import Exchange, Queue
from kombu.mixins import ConsumerMixin
from kombu.utils import kwdict
from queues import task_queues
+
class Worker(ConsumerMixin):
def get_consumers(self, Consumer, channel):
@@ -26,5 +26,3 @@ if __name__ == "__main__":
with BrokerConnection("amqp://guest:guest@localhost:5672//") as conn:
Worker(conn).run()
-
-