From 9830bd00964a1c83cfc92151446adda6f14fbc54 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Tue, 20 Oct 2015 15:31:09 -0300 Subject: [refactor] CouchDocument is now ServerDocument As SoledadBackend is intended to be database agnostic, a new generic document is now used instead of the old one made for CouchDB. The only attribute that really relates to couch was couch_rev, removed on this commit as it can be set on CouchDatabase implementation when needed. --- scripts/profiling/mail/mx.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/profiling/mail/mx.py b/scripts/profiling/mail/mx.py index b6a1e5cf..55084a40 100644 --- a/scripts/profiling/mail/mx.py +++ b/scripts/profiling/mail/mx.py @@ -5,7 +5,7 @@ import timeit from leap.keymanager import openpgp -from leap.soledad.common.couch import CouchDocument +from leap.soledad.common.document import ServerDocument from leap.soledad.common.crypto import ( EncryptionSchemes, ENC_JSON_KEY, @@ -47,7 +47,7 @@ def get_enc_json(pubkey, message): def get_new_doc(enc_json): - doc = CouchDocument(doc_id=str(uuid.uuid4())) + doc = ServerDocument(doc_id=str(uuid.uuid4())) doc.content = { 'incoming': True, ENC_SCHEME_KEY: EncryptionSchemes.PUBKEY, @@ -71,6 +71,7 @@ def put_lots_of_messages(db, number): log("Populating database with %d encrypted messages... " % number, line_break=False) pubkey = get_pubkey() + def _put_one_message(): put_one_message(pubkey, db) time = timeit.timeit(_put_one_message, number=number) -- cgit v1.2.3