Have helper_inbox use helper_sql
This commit is contained in:
parent
7a53d2950b
commit
5b23d99907
|
@ -1,22 +1,9 @@
|
|||
import shared
|
||||
from helper_sql import *
|
||||
|
||||
def insert(t):
|
||||
shared.sqlLock.acquire()
|
||||
shared.sqlSubmitQueue.put(
|
||||
'''INSERT INTO inbox VALUES (?,?,?,?,?,?,?,?,?)''')
|
||||
shared.sqlSubmitQueue.put(t)
|
||||
shared.sqlReturnQueue.get()
|
||||
shared.sqlSubmitQueue.put('commit')
|
||||
shared.sqlLock.release()
|
||||
sqlExecute('''INSERT INTO inbox VALUES (?,?,?,?,?,?,?,?,?)''', *t)
|
||||
|
||||
def trash(msgid):
|
||||
t = (msgid,)
|
||||
shared.sqlLock.acquire()
|
||||
shared.sqlSubmitQueue.put(
|
||||
'''UPDATE inbox SET folder='trash' WHERE msgid=?''')
|
||||
shared.sqlSubmitQueue.put(t)
|
||||
shared.sqlReturnQueue.get()
|
||||
shared.sqlSubmitQueue.put('commit')
|
||||
shared.sqlLock.release()
|
||||
sqlExecute('''UPDATE inbox SET folder='trash' WHERE msgid=?''', msgid)
|
||||
shared.UISignalQueue.put(('removeInboxRowByMsgid',msgid))
|
||||
|
||||
|
|
Reference in New Issue
Block a user