From af10a21be784f5674bc2a6ee759b85b3c348ac2a Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 2 Jan 2011 12:03:10 -0500 Subject: [PATCH] added DataStore.updateCurrentTask() --- DataStore.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/DataStore.py b/DataStore.py index 84b8e16..75b698d 100644 --- a/DataStore.py +++ b/DataStore.py @@ -64,3 +64,16 @@ WHERE id = 0 c.close() self.conn.commit() return ct + + def updateCurrentTask(self, ct): + c = self.conn.cursor() + c.execute(''' +DELETE FROM history +WHERE id = 0 +''') + c.execute(''' +INSERT INTO history +VALUES (0, ?, ?) +''', (ct.taskid, ct.dt.strftime(HISTORY_DT_FMT))) + c.close() + self.conn.commit()