summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/dbTest.py
diff options
context:
space:
mode:
Diffstat (limited to 'notFinishedCode/dbTest.py')
-rw-r--r--notFinishedCode/dbTest.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/notFinishedCode/dbTest.py b/notFinishedCode/dbTest.py
new file mode 100644
index 0000000..a3f2038
--- /dev/null
+++ b/notFinishedCode/dbTest.py
@@ -0,0 +1,38 @@
+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()
+temp = x.tasksList[:]
+for index in range(len(temp)):
+ item = temp[index]
+ taskID = item[0]
+ if item[0] == '17' or item[0] =='18' or item[0]=='19':
+ print "delete a task from temp table", x.deleteTempTask(taskID)
+ x.tasksList.remove(item)
+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]
+ print "call from to ", taskID , callFrom , callTo, taskNo
+print "close connection to the DB", x.closeDBConn()
+
+del x