Repair code style in example-client.py
authorBenjamin Braatz <bb@bbraatz.eu>
Fri, 5 Mar 2021 08:16:09 +0000 (09:16 +0100)
committerBenjamin Braatz <bb@bbraatz.eu>
Fri, 5 Mar 2021 08:16:09 +0000 (09:16 +0100)
example-client.py

index d87a5a2f2930c6ea36009a9869cf410bd59dc6d8..6359db5535f759b630b496e876652f0e3fd7f0b6 100644 (file)
@@ -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.")