added DataStore.clearCurrentTask()

This commit is contained in:
Josh Holtrop 2011-01-02 21:51:31 -05:00
parent 0ee8461ef2
commit 36bfb39320

View File

@ -73,15 +73,21 @@ WHERE id = 0
return ct
def updateCurrentTask(self, ct):
self.clearCurrentTask()
c = self.conn.cursor()
c.execute('''
INSERT INTO history
VALUES (0, ?, ?)
''', (ct.taskid, ct.dt.strftime(HISTORY_DT_FMT)))
c.close()
self.conn.commit()
def clearCurrentTask(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()