Exemplo n.º 1
0
def deleteAllMessages(sms):
    Helper.writeLog('#Begin: DeleteAllMessages function')
    Helper.writeLog('-Password in sms is ' + Password)

    if Password == SavedPassword and SavedPassword != 0:
        Helper.writeLog('-In Delete All Condition')

        Number = sms.number

        Helper.writeLog('-Before Sending the SMS')

        Helper.writeLog('-Deleting SMS')
        AllSMS = SMSHandler.check4SMS()
        if len(AllSMS) > 1:
            for i in range(1, len(AllSMS)):
                SMSHandler.deleteSMS(AllSMS[i].msgindex, 'DELALL')

        SavedPassword = 0
        SMSHandler.sendSMS(Number, 'All messages has been deleted!')
    else:
        Helper.writeLog('-Deleting SMS')
        SMSHandler.deleteSMS(MessageIndex, 'DELALL 2')
Exemplo n.º 2
0
def deleteAllMessages(sms):
	Helper.writeLog('#Begin: DeleteAllMessages function')
	Helper.writeLog('-Password in sms is '+Password)

	if Password == SavedPassword and SavedPassword != 0 :
		Helper.writeLog('-In Delete All Condition')

		Number = sms.number

		Helper.writeLog('-Before Sending the SMS')

		Helper.writeLog('-Deleting SMS')
		AllSMS = SMSHandler.check4SMS()
		if len(AllSMS) > 1:
			for i in range(1,len(AllSMS)):
				SMSHandler.deleteSMS(AllSMS[i].msgindex,'DELALL')

		SavedPassword = 0
		SMSHandler.sendSMS(Number,'All messages has been deleted!')
	else :
		Helper.writeLog('-Deleting SMS')
		SMSHandler.deleteSMS(MessageIndex,'DELALL 2')
Exemplo n.º 3
0
import md5
import GPIO
import SMSHandler
import Helper

WEBSVC_UPD_INTERVAL = 2
SLEEP_INTERVAL = 30
COUNTER = WEBSVC_UPD_INTERVAL

try:
    Helper.SavedPassword = SMSHandler.getSavedPassword()
except Exception, e:
    Helper.writeLog('###GetSavedPassword Exception###')
    Helper.writeLog(str(e))

while 1:
    try:
        Helper.writeLog('#Begin: While loop')
        Helper.writeLog('-Saved pass is ' + str(Helper.SavedPassword))
        SMSListResult = SMSHandler.check4SMS()
        if len(SMSListResult) > 0:
            for i in range(0, len(SMSListResult)):
                SMSHandler.processSingleSMS(SMSListResult[i])

        Helper.writeLog('-Finished While Loop')
    except Exception, e:
        Helper.writeLog('###While Loop Exception###')
        Helper.writeLog(str(e))

    MOD.sleep(SLEEP_INTERVAL)