lib/cas/db.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 7da308189f98b834aa6f368c5b0a36c606750deb
Author: Adam Stokes <adam.stokes(a)gmail.com>
Date: Tue Apr 14 12:16:57 2009 -0400
- tuples for data entry
diff --git a/lib/cas/db.py b/lib/cas/db.py
index e68a2f2..b71757a 100644
--- a/lib/cas/db.py
+++ b/lib/cas/db.py
@@ -42,6 +42,7 @@ class CasStorage(object):
# DEBUGINFO METHODS
def addDebuginfoRPM(self, debuginfo):
+ debuginfo = (debuginfo,)
self.cursor.execute("SELECT * from debuginfo where rpm=?", debuginfo)
if not self.cursor.fetchone():
self.cursor.execute("INSERT into debuginfo('rpm')
values(?)", debuginfo)
@@ -55,8 +56,9 @@ class CasStorage(object):
# TIMESTAMP METHODS
def addTimestamp(self, id, debug, timestamp):
""" build relation to debuginfo rpm and add debug path, timestamp
"""
+ values = (id, debug, timestamp)
self.cursor.execute("""INSERT into timestamp
('debug_id','debugpath',
- 'timestamp') values(?,?,?)""", id, debug, timestamp)
+ 'timestamp') values(?,?,?)""", values)
self.commit()
return
@@ -68,6 +70,7 @@ class CasStorage(object):
def getJobById(self, id):
""" single job """
+ id = (id,)
self.cursor.execute("SELECT * FROM cas_jobs where id=?", id)
return self.cursor.fetchone()
@@ -79,7 +82,8 @@ class CasStorage(object):
def addJob(self, submitter, corepath, debug_id, server_id):
""" add job to db """
+ values = (date, submitter, corepath, debug_id, server_id, 0)
self.cursor.execute("""INSERT into cas_jobs
('date','submitter',
'corepath', debug_id, server_id, iterations)
- values (?,?,?,?,?,?)""", date, submitter, corepath, debug_id,
server_id, 0)
+ values (?,?,?,?,?,?)""", values)
return