diff options
author | Kali Kaneko <kali@leap.se> | 2015-06-04 10:23:07 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-06-05 16:50:46 -0400 |
commit | 0e868109cf842dc60466a0b6b5b86311246a013e (patch) | |
tree | 9cd44cc08a4911534cc68e29484ce4400af15d31 /mail/src/leap | |
parent | ddd67ecc07c10f0b48e9f14839c1a8a172d87f1c (diff) |
[feature] use operation, doesn't return result
Diffstat (limited to 'mail/src/leap')
-rw-r--r-- | mail/src/leap/mail/mailbox_indexer.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mail/src/leap/mail/mailbox_indexer.py b/mail/src/leap/mail/mailbox_indexer.py index 664d5804..ab0967d8 100644 --- a/mail/src/leap/mail/mailbox_indexer.py +++ b/mail/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()) |