From 5b23d999077e474f63ca014302f2a78bcbca33c9 Mon Sep 17 00:00:00 2001 From: "Grant T. Olson" Date: Tue, 27 Aug 2013 08:13:40 -0400 Subject: [PATCH] Have helper_inbox use helper_sql --- src/helper_inbox.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/helper_inbox.py b/src/helper_inbox.py index fc420825..5d746010 100644 --- a/src/helper_inbox.py +++ b/src/helper_inbox.py @@ -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))