diff options
author | Ask Solem <ask@celeryproject.org> | 2012-09-21 14:18:16 +0100 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2012-09-21 14:18:37 +0100 |
commit | 9960aed306833e1299e7e3bf3e317adee3a4a6f4 (patch) | |
tree | 48a09f87cf3fcc7779e56c9e0bc3c230c4074b9b | |
parent | f678dc46fff91ae6cf07fc7b1ed0ebcc3ce9a7af (diff) | |
download | kombu-9960aed306833e1299e7e3bf3e317adee3a4a6f4.tar.gz |
examples/ cosmetics
-rw-r--r-- | examples/complete_receive.py | 21 | ||||
-rw-r--r-- | examples/simple_eventlet_receive.py | 2 | ||||
-rwxr-xr-x | extra/release/bump_version.py | 1 |
3 files changed, 12 insertions, 12 deletions
diff --git a/examples/complete_receive.py b/examples/complete_receive.py index e0093c0b..d7c8e948 100644 --- a/examples/complete_receive.py +++ b/examples/complete_receive.py @@ -28,17 +28,16 @@ def handle_message(body, message): #: the values below are the default, but listed here so it can #: be easily changed. with Connection('pyamqp://guest:guest@localhost:5672//') as connection: - - """The configuration of the message flow is as follows: - gateway_kombu_exchange -> internal_kombu_exchange -> kombu_demo queue - """ - gateway_exchange = Exchange('gateway_kombu_demo', type='direct') - exchange = Exchange('internal_kombu_demo', type='direct') - binded = exchange.bind(connection.channel()) - binded.exchange_bind(gateway_exchange, routing_key = 'kombu_demo') - + # The configuration of the message flow is as follows: + # gateway_kombu_exchange -> internal_kombu_exchange -> kombu_demo queue + gateway_exchange = Exchange('gateway_kombu_demo')(connection) + exchange = Exchange('internal_kombu_demo')(connection) + gateway_exchange.declare() + exchange.declare() + exchange.bind_to(gateway_exchange, routing_key='kombu_demo') + queue = Queue('kombu_demo', exchange, routing_key='kombu_demo') - + #: Create consumer using our callback and queue. #: Second argument can also be a list to consume from #: any number of queues. @@ -46,7 +45,7 @@ with Connection('pyamqp://guest:guest@localhost:5672//') as connection: #: This waits for a single event. Note that this event may not #: be a message, or a message that is to be delivered to the consumers - #: channel, but any event received on the connection. + #: channel, but any event received on the connection. recv = eventloop(connection) while True: recv.next() diff --git a/examples/simple_eventlet_receive.py b/examples/simple_eventlet_receive.py index a8208650..1f88e713 100644 --- a/examples/simple_eventlet_receive.py +++ b/examples/simple_eventlet_receive.py @@ -40,4 +40,4 @@ def wait_many(timeout=1): message.ack() print(message.payload) -spawn(wait_many).wait() +eventlet.spawn(wait_many).wait() diff --git a/extra/release/bump_version.py b/extra/release/bump_version.py index 02d8727c..ccf7355e 100755 --- a/extra/release/bump_version.py +++ b/extra/release/bump_version.py @@ -122,6 +122,7 @@ _filetype_to_type = {"py": PyVersion, "c": CPPVersion, "h": CPPVersion} + def filetype_to_type(filename): _, _, suffix = filename.rpartition(".") return _filetype_to_type[suffix](filename) |