Add: debugging for freezing api call
This commit is contained in:
parent
9c0b7efda0
commit
a2cd3cbfc2
|
@ -522,8 +522,14 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
data += ']}'
|
data += ']}'
|
||||||
return data
|
return data
|
||||||
elif method == 'getAllSentMessages':
|
elif method == 'getAllSentMessages':
|
||||||
|
import pprint
|
||||||
|
try:
|
||||||
queryreturn = sqlQuery('''SELECT msgid, toaddress, fromaddress, subject, lastactiontime, message, encodingtype, status, ackdata FROM sent where folder='sent' ORDER BY lastactiontime''')
|
queryreturn = sqlQuery('''SELECT msgid, toaddress, fromaddress, subject, lastactiontime, message, encodingtype, status, ackdata FROM sent where folder='sent' ORDER BY lastactiontime''')
|
||||||
|
except:
|
||||||
|
print "Exception in getallSentMessages"
|
||||||
|
pprint.pprint (queryreturn)
|
||||||
data = '{"sentMessages":['
|
data = '{"sentMessages":['
|
||||||
|
if type(queryreturn) is list:
|
||||||
for row in queryreturn:
|
for row in queryreturn:
|
||||||
msgid, toAddress, fromAddress, subject, lastactiontime, message, encodingtype, status, ackdata = row
|
msgid, toAddress, fromAddress, subject, lastactiontime, message, encodingtype, status, ackdata = row
|
||||||
subject = shared.fixPotentiallyInvalidUTF8Data(subject)
|
subject = shared.fixPotentiallyInvalidUTF8Data(subject)
|
||||||
|
@ -531,6 +537,9 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
if len(data) > 25:
|
if len(data) > 25:
|
||||||
data += ','
|
data += ','
|
||||||
data += json.dumps({'msgid':msgid.encode('hex'), 'toAddress':toAddress, 'fromAddress':fromAddress, 'subject':subject.encode('base64'), 'message':message.encode('base64'), 'encodingType':encodingtype, 'lastActionTime':lastactiontime, 'status':status, 'ackData':ackdata.encode('hex')}, indent=4, separators=(',', ': '))
|
data += json.dumps({'msgid':msgid.encode('hex'), 'toAddress':toAddress, 'fromAddress':fromAddress, 'subject':subject.encode('base64'), 'message':message.encode('base64'), 'encodingType':encodingtype, 'lastActionTime':lastactiontime, 'status':status, 'ackData':ackdata.encode('hex')}, indent=4, separators=(',', ': '))
|
||||||
|
else:
|
||||||
|
print "queryreturn is not a list"
|
||||||
|
pprint.pprint (queryreturn)
|
||||||
data += ']}'
|
data += ']}'
|
||||||
return data
|
return data
|
||||||
elif method == 'getAllSentMessageIds' or method == 'getAllSentMessageIDs':
|
elif method == 'getAllSentMessageIds' or method == 'getAllSentMessageIDs':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user