summaryrefslogtreecommitdiff
path: root/examples/complete_receive.py
diff options
context:
space:
mode:
authorThomas Grainger <tagrain@gmail.com>2021-07-20 14:07:49 +0100
committerGitHub <noreply@github.com>2021-07-20 19:07:49 +0600
commit241b5dcff8a7c8ad411e1b325d59e47acfa9e1ed (patch)
tree14b5c70fb2e2e2e4c53356d8a21da0540da16759 /examples/complete_receive.py
parent1ce0afe39ab26487c1cdfd9d4ba8c5bb445c8f32 (diff)
downloadkombu-241b5dcff8a7c8ad411e1b325d59e47acfa9e1ed.tar.gz
enable pre-commit (#1355)
* enable pre-commit * use extend-ignore for flake8 * manual flake8 fixes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update kombu/__init__.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'examples/complete_receive.py')
-rw-r--r--examples/complete_receive.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/complete_receive.py b/examples/complete_receive.py
index f122262a..21903c59 100644
--- a/examples/complete_receive.py
+++ b/examples/complete_receive.py
@@ -6,7 +6,7 @@ and exits.
from pprint import pformat
-from kombu import Connection, Exchange, Queue, Consumer, eventloop
+from kombu import Connection, Consumer, Exchange, Queue, eventloop
#: By default messages sent to exchanges are persistent (delivery_mode=2),
#: and queues and exchanges are durable.
@@ -21,10 +21,11 @@ def pretty(obj):
#: This is the callback applied when a message is received.
def handle_message(body, message):
print(f'Received message: {body!r}')
- print(' properties:\n{}'.format(pretty(message.properties)))
- print(' delivery_info:\n{}'.format(pretty(message.delivery_info)))
+ print(f' properties:\n{pretty(message.properties)}')
+ print(f' delivery_info:\n{pretty(message.delivery_info)}')
message.ack()
+
#: Create a connection and a channel.
#: If hostname, userid, password and virtual_host is not specified
#: the values below are the default, but listed here so it can