Skip to content

Commit

Permalink
Repair example scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
kratochvil01 committed Apr 10, 2024
1 parent 127000a commit 19e0fac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/test_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@app.route('/', methods=['POST', 'GET'])
def respond():
print(dict(request.values))
print(request.data.decode(), request.environ['CONTENT_TYPE'])
return json.dumps({"status": "success"}), 200


Expand Down
14 changes: 7 additions & 7 deletions examples/test_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def on_error(ws, error):
print(f"Encountered an error: {error}")


def on_close(ws):
def on_close(ws, _, __):
print("WebSocket connection closed")


Expand All @@ -24,9 +24,9 @@ def on_open(ws):


if __name__ == "__main__":
ws = websocket.WebSocketApp(f"ws://{host}/ws",
on_message=on_message,
on_error=on_error,
on_close=on_close)
ws.on_open = on_open
ws.run_forever()
_ws = websocket.WebSocketApp(f"ws://{host}/ws",
on_message=on_message,
on_error=on_error,
on_close=on_close)
_ws.on_open = on_open
_ws.run_forever()

0 comments on commit 19e0fac

Please sign in to comment.