add debug
This commit is contained in:
parent
a9e4febaa5
commit
b6e11f148f
@ -36,25 +36,29 @@ def sendsmpmessage(target, message):
|
||||
responsejson = ws.recv() # Receive response
|
||||
response = json.loads(responsejson)
|
||||
# ws.close()
|
||||
if response is not None:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
for chatitem in response['resp']['chatItems']:
|
||||
statusdict = chatitem['chatItem']['meta']['itemStatus']
|
||||
try:
|
||||
status = statusdict['sndProgress']
|
||||
except KeyError:
|
||||
pprint(response['resp']['chatItems'])
|
||||
print('---')
|
||||
pprint(chatitem)
|
||||
print("FAILED")
|
||||
status = 'FAILED'
|
||||
else:
|
||||
smessage = chatitem['chatItem']['meta']['itemText']
|
||||
print("Message '%s' sent over websocket to %s, status was %s" % (smessage, target, status))
|
||||
# for chatitem in response['resp']['chatItems']:
|
||||
# statusdict = chatitem['chatItem']['meta']['itemStatus']
|
||||
# try:
|
||||
# status = statusdict['sndProgress']
|
||||
# except KeyError:
|
||||
# pprint(response['resp']['chatItems'])
|
||||
# print('---')
|
||||
# pprint(chatitem)
|
||||
# print("FAILED")
|
||||
# status = 'FAILED'
|
||||
# else:
|
||||
# smessage = chatitem['chatItem']['meta']['itemText']
|
||||
# print("Message '%s' sent over websocket to %s, status was %s" % (smessage, target, status))
|
||||
|
||||
if status == 'complete' or status == 'partial':
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
# if status == 'complete' or status == 'partial':
|
||||
# return True
|
||||
# else:
|
||||
# return False
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user