summaryrefslogtreecommitdiff
path: root/src/leap/mail/mailbox_indexer.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-06-04 10:23:07 -0400
committerKali Kaneko <kali@leap.se>2015-06-05 16:50:46 -0400
commite46b14e6966045414a61103b3819a4277af7d211 (patch)
treee57fea331c0667307a5beee19920cb0eb8697697 /src/leap/mail/mailbox_indexer.py
parent2cf8aa4a285cde6e8bdcaaf1d374b8762d36714c (diff)
[feature] use operation, doesn't return result
Diffstat (limited to 'src/leap/mail/mailbox_indexer.py')
-rw-r--r--src/leap/mail/mailbox_indexer.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/leap/mail/mailbox_indexer.py b/src/leap/mail/mailbox_indexer.py
index 664d580..ab0967d 100644
--- a/src/leap/mail/mailbox_indexer.py
+++ b/src/leap/mail/mailbox_indexer.py
@@ -88,6 +88,10 @@ class MailboxIndexer(object):
assert self.store is not None
return self.store.raw_sqlcipher_query(*args, **kw)
+ def _operation(self, *args, **kw):
+ assert self.store is not None
+ return self.store.raw_sqlcipher_operation(*args, **kw)
+
def create_table(self, mailbox_uuid):
"""
Create the UID table for a given mailbox.
@@ -100,7 +104,8 @@ class MailboxIndexer(object):
"uid INTEGER PRIMARY KEY AUTOINCREMENT, "
"hash TEXT UNIQUE NOT NULL)".format(
preffix=self.table_preffix, name=sanitize(mailbox_uuid)))
- return self._query(sql)
+ print "CREATING TABLE..."
+ return self._operation(sql)
def delete_table(self, mailbox_uuid):
"""
@@ -112,7 +117,7 @@ class MailboxIndexer(object):
check_good_uuid(mailbox_uuid)
sql = ("DROP TABLE if exists {preffix}{name}".format(
preffix=self.table_preffix, name=sanitize(mailbox_uuid)))
- return self._query(sql)
+ return self._operation(sql)
def insert_doc(self, mailbox_uuid, doc_id):
"""
@@ -149,7 +154,7 @@ class MailboxIndexer(object):
"LIMIT 1;").format(
preffix=self.table_preffix, name=sanitize(mailbox_uuid))
- d = self._query(sql, values)
+ d = self._operation(sql, values)
d.addCallback(lambda _: self._query(sql_last))
d.addCallback(get_rowid)
d.addErrback(lambda f: f.printTraceback())