added DataStore.clearCurrentTask()
This commit is contained in:
parent
0ee8461ef2
commit
36bfb39320
14
DataStore.py
14
DataStore.py
@ -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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user