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
|
return ct
|
||||||
|
|
||||||
def updateCurrentTask(self, 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 = self.conn.cursor()
|
||||||
c.execute('''
|
c.execute('''
|
||||||
DELETE FROM history
|
DELETE FROM history
|
||||||
WHERE id = 0
|
WHERE id = 0
|
||||||
''')
|
''')
|
||||||
c.execute('''
|
|
||||||
INSERT INTO history
|
|
||||||
VALUES (0, ?, ?)
|
|
||||||
''', (ct.taskid, ct.dt.strftime(HISTORY_DT_FMT)))
|
|
||||||
c.close()
|
c.close()
|
||||||
self.conn.commit()
|
self.conn.commit()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user