Skip to content

Commit 62fe446

Browse files
committed
format
Signed-off-by: Gabriele Santomaggio <[email protected]>
1 parent a2e5993 commit 62fe446

File tree

4 files changed

+27
-32
lines changed

4 files changed

+27
-32
lines changed

examples/getting_started/getting_started.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self):
2424
self._count = 0
2525

2626
def on_amqp_message(self, event: Event):
27-
print("received message: {} ".format(''.join(map(chr, event.message.body))))
27+
print("received message: {} ".format("".join(map(chr, event.message.body))))
2828

2929
# accepting
3030
self.delivery_context.accept(event)
@@ -122,7 +122,9 @@ def main() -> None:
122122
# publish 10 messages
123123
for i in range(MESSAGES_TO_PUBLISH):
124124
print("publishing")
125-
status = publisher.publish(Message(body=str.encode("test message {} ".format(i))))
125+
status = publisher.publish(
126+
Message(body=str.encode("test message {} ".format(i)))
127+
)
126128
if status.remote_state == OutcomeState.ACCEPTED:
127129
print("message accepted")
128130
elif status.remote_state == OutcomeState.RELEASED:

rabbitmq_amqp_python_client/qpid/proton/_exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class MessageException(ProtonException):
5858

5959
pass
6060

61+
6162
class ArgumentOutOfRangeException(MessageException):
6263
"""
6364
An exception class raised when an argument is out of range.

rabbitmq_amqp_python_client/qpid/proton/_message.py

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,7 @@ class Message(object):
109109
DEFAULT_PRIORITY = PN_DEFAULT_PRIORITY
110110
""" Default AMQP message priority"""
111111

112-
def __init__(
113-
self,
114-
body: Union[
115-
bytes, dict, None
116-
] = None,
117-
**kwargs
118-
) -> None:
112+
def __init__(self, body: Union[bytes, dict, None] = None, **kwargs) -> None:
119113
# validate the types
120114

121115
if not isinstance(body, (bytes, dict, type(None))):
@@ -513,7 +507,7 @@ def instructions(self) -> Optional[AnnotationDict]:
513507

514508
@instructions.setter
515509
def instructions(
516-
self, instructions: Optional[Dict[Union[str, int], "PythonAMQPData"]]
510+
self, instructions: Optional[Dict[Union[str, int], "PythonAMQPData"]]
517511
) -> None:
518512
if isinstance(instructions, dict):
519513
self.instruction_dict = AnnotationDict(instructions, raise_on_error=False)
@@ -536,7 +530,7 @@ def annotations(self) -> Optional[AnnotationDict]:
536530

537531
@annotations.setter
538532
def annotations(
539-
self, annotations: Optional[Dict[Union[str, int], "PythonAMQPData"]]
533+
self, annotations: Optional[Dict[Union[str, int], "PythonAMQPData"]]
540534
) -> None:
541535
if isinstance(annotations, dict):
542536
self.annotation_dict = AnnotationDict(annotations, raise_on_error=False)
@@ -603,8 +597,7 @@ def send(self, sender: "Sender", tag: Optional[str] = None) -> "Delivery":
603597
return dlv
604598

605599
@overload
606-
def recv(self, link: "Sender") -> None:
607-
...
600+
def recv(self, link: "Sender") -> None: ...
608601

609602
def recv(self, link: "Receiver") -> Optional["Delivery"]:
610603
"""
@@ -635,24 +628,24 @@ def recv(self, link: "Receiver") -> Optional["Delivery"]:
635628
def __repr__(self) -> str:
636629
props = []
637630
for attr in (
638-
"inferred",
639-
"address",
640-
"reply_to",
641-
"durable",
642-
"ttl",
643-
"priority",
644-
"first_acquirer",
645-
"delivery_count",
646-
"id",
647-
"correlation_id",
648-
"user_id",
649-
"group_id",
650-
"group_sequence",
651-
"reply_to_group_id",
652-
"instructions",
653-
"annotations",
654-
"properties",
655-
"body",
631+
"inferred",
632+
"address",
633+
"reply_to",
634+
"durable",
635+
"ttl",
636+
"priority",
637+
"first_acquirer",
638+
"delivery_count",
639+
"id",
640+
"correlation_id",
641+
"user_id",
642+
"group_id",
643+
"group_sequence",
644+
"reply_to_group_id",
645+
"instructions",
646+
"annotations",
647+
"properties",
648+
"body",
656649
):
657650
value = getattr(self, attr)
658651
if value:

rabbitmq_amqp_python_client/qpid/proton/_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def send(
176176
:return: Delivery object for this message.
177177
"""
178178

179-
180179
delivery = self.link.send(msg)
181180
self.connection.wait(
182181
lambda: _is_settled(delivery),

0 commit comments

Comments
 (0)