Make better use of the db



git-svn-id: http://test.kernel.org/svn/autotest/trunk@314 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/tko/db.py b/tko/db.py
index d349ed4..e06fc1f 100644
--- a/tko/db.py
+++ b/tko/db.py
@@ -7,6 +7,22 @@
 
 
 	def select(self, cmd):
+		print 'select ' + cmd
 		self.cur.execute('select ' + cmd)
 		return self.cur.fetchall()
 
+
+	def insert_job(self, tag, job):
+		command = 'insert into jobs ' + \
+			'(job, version, status, reason, machine, kernel) ' +\
+			'values (%s, %s, %s, %s, %s, %s) '
+		values = (tag, job.kernel, job.status_num, job.reason, \
+			 job.machine, job.kernel)
+		self.cur.execute(command, values)
+		self.con.commit();
+
+
+	def find_job(self, tag):
+		command = 'select * from jobs where job = %s'
+		self.cur.execute(command, tag)
+		return self.cur.fetchall()