summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/dbTest.py
blob: c98076445ceafcf24124a5285109fbcceb111ebe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import dbClass
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 '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 index in range(len(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
		#del x.tasksList[index-1]
print '\n\n\n\n'
#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
#-----------------------------------------------------------------------------------
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
for item in x.tasksList[:]:
        taskID = item[0]
        taskNo = item[1]
        callFrom = item[2]
        callTo = item[3]
	testDone = item[4]
        print "call from to ", taskID , callFrom , callTo, taskNo, testDone
print "close connection to the DB", x.closeDBConn()

del x