import dbClass from time import sleep user = 'root' passw = 'randompasswordSQL' host = 'localhost' dbname = 'gsmselftesting' x = dbClass.DBMySQLConnection(user, passw, host, dbname) print "connected to the DB ", x.connectDB() print "do i have anything to do", x.anyTasksToDo() print 'mutex says' , x.lockMutex(10) print 'release mutex says ', x.releaseMutex() sleep(45) for item in x.tasksList: item = x.tasksList[index] tempItem = item taskID = item[0] taskNo = item[1] callFrom = item[2] callTo = item[3] testDone = item[4] print "call from to ", taskID , callFrom , callTo, taskNo, testDone if testDone == str(0): print item[0] tempItem[4]=str(1) print "delete a task from temp table", x.deleteTempTask(taskID) x.tasksList[index]=tempItem print "found", x.searchTaskList('S1IP2','GSM1') #if variable == 0: # print x.insertTaskIn2('gsm4','sip8',2) print "remove a task ",x.removeTaskFromList('2') #print x.cleanTasksList() for item in x.tasksList: device = item[3] print "device name", device deviceAN= x.deviceAddress(str(device)) print "device's IP and number", deviceAN[0], deviceAN[1] print "update task result ", x.updateTaskResult(1,3) print "update ping Table", x.updatePingResult(1,5,4,3,2,1) print "delete a task from temp table", x.deleteTempTask(2) print "add a result to the table", x.addResult(4,34) #new task to do #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ #just made for Tri :)--------------------------------------------------------------- #print x.cleanTasksList() #print "do i have any task from SIP1 to GSM1 to do", x.anyTasksFromTo('SIP2', 'GSMu1', 2) #for item in x.tasksList: # taskID = item[0] # callFrom = item[1] # callTo = item[2] # print "call from to ", taskID , callFrom , callTo #print 'i am inserting into the table something', x.insertTaskIn2('gsm4','sip8',2) #print 'i am inserting into the table something', x.insertTaskIn2('gsm4','sip8',2) #print 'i am inserting into the table something', x.insertTaskIn2('gsm4','sip8',2) #print 'i am inserting into the table something', x.insertTaskIn2('gsm4','sip8',2) #----------------------------------------------------------------------------------- #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ for item in x.tasksList: taskID = item[0] taskNo = item[1] callFrom = item[2] callTo = item[3] print "call from to ", taskID , callFrom , callTo, taskNo print "close connection to the DB", x.closeDBConn() del x