@@ -242,9 +242,9 @@ async def broadcast_message(self, message: FlockwaveNotification) -> Request:
242242 the request object that identifies this message in the outbound
243243 message queue. It can be used to wait until the message is delivered
244244 """
245- assert isinstance (
246- message , FlockwaveNotification
247- ), "only notifications may be broadcast"
245+ assert isinstance (message , FlockwaveNotification ), (
246+ "only notifications may be broadcast"
247+ )
248248
249249 request = Request (message )
250250 await self ._queue_tx .send (request )
@@ -379,9 +379,9 @@ def enqueue_broadcast_message(self, message: FlockwaveNotification) -> None:
379379 Parameters:
380380 message: the notification to enqueue
381381 """
382- assert isinstance (
383- message , FlockwaveNotification
384- ), "only notifications may be broadcast"
382+ assert isinstance (message , FlockwaveNotification ), (
383+ "only notifications may be broadcast"
384+ )
385385
386386 # Don't return the request here because it is not guaranteed that it
387387 # ends up in the queue; it may be dropped
@@ -423,9 +423,9 @@ def enqueue_message(
423423 message , in_response_to = in_response_to
424424 )
425425 if to is None :
426- assert isinstance (
427- message , FlockwaveNotification
428- ), "broadcast messages cannot be sent in response to a particular message"
426+ assert isinstance (message , FlockwaveNotification ), (
427+ "broadcast messages cannot be sent in response to a particular message"
428+ )
429429 return self .enqueue_broadcast_message (message )
430430 else :
431431 # Don't return the request here because it is not guaranteed that it
@@ -549,12 +549,12 @@ def _commit_broadcast_methods(
549549 """Calculates the list of methods to call when the message hub
550550 wishes to broadcast a message to all the connected clients.
551551 """
552- assert (
553- self . _client_registry is not None
554- ), "message hub does not have a client registry yet"
555- assert (
556- self . _channel_type_registry is not None
557- ), "message hub does not have a channel type registry yet"
552+ assert self . _client_registry is not None , (
553+ "message hub does not have a client registry yet"
554+ )
555+ assert self . _channel_type_registry is not None , (
556+ "message hub does not have a channel type registry yet"
557+ )
558558
559559 result = []
560560 clients_for = self ._client_registry .client_ids_for_channel_type
@@ -832,9 +832,9 @@ async def send_message(
832832 )
833833
834834 if to is None :
835- assert isinstance (
836- message , FlockwaveNotification
837- ), "broadcast messages cannot be sent in response to a particular message"
835+ assert isinstance (message , FlockwaveNotification ), (
836+ "broadcast messages cannot be sent in response to a particular message"
837+ )
838838 return await self .broadcast_message (message )
839839 else :
840840 request = Request (message , to = to , in_response_to = in_response_to )
@@ -1068,9 +1068,9 @@ async def _send_message(
10681068 in_response_to : Optional [FlockwaveMessage ] = None ,
10691069 done : Optional [Callable [[], None ]] = None ,
10701070 ):
1071- assert (
1072- self . _client_registry is not None
1073- ), "message hub does not have a client registry yet"
1071+ assert self . _client_registry is not None , (
1072+ "message hub does not have a client registry yet"
1073+ )
10741074
10751075 if not isinstance (to , Client ):
10761076 try :
0 commit comments