Debug
This commit is contained in:
parent
62e7468eb2
commit
e364c7d965
@ -29,12 +29,12 @@ def sendmessage(target, message):
|
||||
json_command = json.dumps(command)
|
||||
|
||||
""" Connects to WebSocket server, sends a message, and returns the response """
|
||||
uri = "ws://localhost:5080"
|
||||
ws = websocket.create_connection(uri) # Blocking WebSocket connection
|
||||
# uri = "ws://localhost:5080"
|
||||
# ws = websocket.create_connection(uri) # Blocking WebSocket connection
|
||||
ws.send(json_command) # Send message to WebSocket
|
||||
responsejson = ws.recv() # Receive response
|
||||
response = json.loads(responsejson)
|
||||
ws.close()
|
||||
# ws.close()
|
||||
|
||||
for chatitem in response['resp']['chatItems']:
|
||||
statusdict = chatitem['chatItem']['meta']['itemStatus']
|
||||
@ -49,7 +49,11 @@ def sendmessage(target, message):
|
||||
print("Message '%s' sent over websocket to %s, status was %s" % (smessage, target, status))
|
||||
|
||||
if status == 'complete':
|
||||
return True
|
||||
if smessage != message:
|
||||
print("Sent duplicate message, FAIL")
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
@ -79,5 +83,5 @@ def webhook_receiver(id):
|
||||
if __name__ == '__main__':
|
||||
print("Started %s" % (versionstring))
|
||||
uri = "ws://localhost:5080"
|
||||
# ws = websocket.create_connection(uri)
|
||||
ws = websocket.create_connection(uri)
|
||||
app.run()
|
||||
|
Loading…
Reference in New Issue
Block a user