From db3d45d651e30a3de568695ebcb5d1024b2c0506 Mon Sep 17 00:00:00 2001 From: Benjamin Braatz Date: Fri, 5 Mar 2021 09:16:09 +0100 Subject: [PATCH] Repair code style in example-client.py --- example-client.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/example-client.py b/example-client.py index d87a5a2..6359db5 100644 --- a/example-client.py +++ b/example-client.py @@ -5,8 +5,10 @@ import websockets async def test_commands(websocket): - commands = [{'target': 'Example State', 'command': 'set state', 'state': True}, - {'target': 'Example State', 'command': 'get state'}] + commands = [{'target': 'Example State', + 'command': 'set state', 'state': True}, + {'target': 'Example State', 'command': + 'get state'}] for command in commands: message = json.dumps(command) await websocket.send(message) @@ -30,7 +32,8 @@ async def main(): await asyncio.sleep(0.1) print("Wait for 1.9 seconds for delayed messages.") await asyncio.sleep(1.9) - async with websockets.connect(f"ws://localhost:8080/Example-Client") as websocket: + async with websockets.connect(f"ws://localhost:8080/Example-Client")\ + as websocket: print("Sending commands to websocket 'Example-Client'.") command_task = asyncio.create_task(test_commands(websocket)) print("Receiving messages from the websocket.") -- 2.34.1