add debug
This commit is contained in:
parent
a9e4febaa5
commit
b6e11f148f
@ -36,26 +36,30 @@ def sendsmpmessage(target, message):
|
|||||||
responsejson = ws.recv() # Receive response
|
responsejson = ws.recv() # Receive response
|
||||||
response = json.loads(responsejson)
|
response = json.loads(responsejson)
|
||||||
# ws.close()
|
# ws.close()
|
||||||
|
if response is not None:
|
||||||
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
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
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))
|
||||||
|
|
||||||
|
# if status == 'complete' or status == 'partial':
|
||||||
|
# return True
|
||||||
|
# else:
|
||||||
|
# return False
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print("Tellme Notifier started...")
|
print("Tellme Notifier started...")
|
||||||
|
Loading…
Reference in New Issue
Block a user