summaryrefslogtreecommitdiffstats
path: root/notFinishedCode
diff options
context:
space:
mode:
authorRefik Hadzialic2011-07-26 14:46:54 +0200
committerRefik Hadzialic2011-07-26 14:46:54 +0200
commitd98fe65c2970eb14b309d316b3c1e6c6856f96ce (patch)
treeb08e29ab315f683f62927caadfb39f001b256c14 /notFinishedCode
parentdelete bad file (diff)
downloadgsm-selftest-d98fe65c2970eb14b309d316b3c1e6c6856f96ce.tar.gz
gsm-selftest-d98fe65c2970eb14b309d316b3c1e6c6856f96ce.tar.xz
gsm-selftest-d98fe65c2970eb14b309d316b3c1e6c6856f96ce.zip
I made some changes, I added an attribute field if the task was done before so we dont have to remove items in tasksList where we had before the problem of shifting indexes.
Diffstat (limited to 'notFinishedCode')
-rw-r--r--notFinishedCode/dbClass.py2
-rw-r--r--notFinishedCode/dbClass.pycbin7528 -> 7570 bytes
-rw-r--r--notFinishedCode/dbTest.py23
3 files changed, 18 insertions, 7 deletions
diff --git a/notFinishedCode/dbClass.py b/notFinishedCode/dbClass.py
index dc7ca41..90e4758 100644
--- a/notFinishedCode/dbClass.py
+++ b/notFinishedCode/dbClass.py
@@ -67,6 +67,7 @@ class DBMySQLConnection:
columns = list()
for entry in record:
columns.append(str(entry))
+ columns.append(str(0))
self.tasksList.append(columns)
return 1
except MySQLdb.Error, e:
@@ -239,6 +240,7 @@ class DBMySQLConnection:
columns.append(str(taskNo))
columns.append(str(fromDevice))
columns.append(str(toDevice))
+ columns.append(str(0))
self.tasksList.append(columns)
return 1
diff --git a/notFinishedCode/dbClass.pyc b/notFinishedCode/dbClass.pyc
index e765173..61c02a8 100644
--- a/notFinishedCode/dbClass.pyc
+++ b/notFinishedCode/dbClass.pyc
Binary files differ
diff --git a/notFinishedCode/dbTest.py b/notFinishedCode/dbTest.py
index 5d62f3e..c980764 100644
--- a/notFinishedCode/dbTest.py
+++ b/notFinishedCode/dbTest.py
@@ -12,13 +12,21 @@ 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), -1, -1):
- if index != 0:
- item = x.tasksList[index-1]
- taskID = item[0]
+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]
- print "delete a task from temp table", x.deleteTempTask(taskID)
- del x.tasksList[index-1]
+ 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
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
@@ -37,7 +45,8 @@ for item in x.tasksList[:]:
taskNo = item[1]
callFrom = item[2]
callTo = item[3]
- print "call from to ", taskID , callFrom , callTo, taskNo
+ testDone = item[4]
+ print "call from to ", taskID , callFrom , callTo, taskNo, testDone
print "close connection to the DB", x.closeDBConn()
del x