elif msgfolder == "Messages" : msglen = len(voice.sms().messages) for message in voice.sms().messages: counter = doactions(counter, ACTION, message.id , ID) if (msglen == counter) : break elif msgfolder == "All" : voice.all() folder = voice.all.folder msglen = len(folder.messages) for message in folder.messages: counter = doactions(counter, ACTION, message.id , ID) if (msglen == counter) : break elif msgfolder == "Placed" : msglen = len(voice.placed().messages) for message in voice.placed().messages: counter = doactions(counter, ACTION, message.id , ID) if (msglen == counter) : break elif msgfolder == "Received" : msglen = len(voice.received().messages) for message in voice.received().messages: counter = doactions(counter, ACTION, message.id , ID) if (msglen == counter) : break elif msgfolder == "Spam" : voice.spam() folder = voice.spam.folder msglen = len(folder.messages) for message in folder.messages:
folder = voice.sms().messages foundmsg = [ msg for msg in folder] elif command == "All" : voice.all() folder = voice.all.folder foundmsg = [ msg for msg in folder.messages] elif command == "Spam" : voice.spam() folder = voice.spam.folder foundmsg = [ msg for msg in folder.messages] elif command == "Trash" : voice.trash() folder = voice.trash.folder foundmsg = [ msg for msg in folder.messages] elif command == "Placed" : folder = voice.placed().messages foundmsg = [ msg for msg in folder] elif command == "Received" : voice.received() folder = voice.received.messages foundmsg = [ msg for msg in folder] elif command == "Missed" : folder = voice.missed().messages foundmsg = [ msg for msg in folder] #elif command == "History" : #try: #phone = argv[4] #folder = voice.search(phone) #foundmsg = [ msg for msg in folder.messages if (msg.messageText != "") ] #except: #print ('Error! Please provide a phone number. ')
voice.recorded() allmessages = extractdata(voice.recorded.html) elif command == "Messages" : voice.sms() allmessages = extractdata(voice.sms.html) elif command == "All" : voice.all() allmessages = extractdata(voice.all.html) elif command == "Spam" : voice.spam() allmessages = extractdata(voice.spam.html) elif command == "Trash" : voice.trash() allmessages = extractdata(voice.trash.html) elif command == "Placed" : voice.placed() allmessages = extractdata(voice.placed.html) elif command == "Received" : voice.received() allmessages = extractdata(voice.received.html) elif command == "Missed" : voice.missed() allmessages = extractdata(voice.missed.html) if allmessages != []: foundmsg = [msg for msg in allmessages if (msg['id'] == unicode(ID))] if foundmsg != []: foundmsg.sort(key=lambda x:x['time'], reverse=False) print json.dumps(foundmsg, indent=4, default=str) else: