diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2015-08-06 17:35:41 -0300 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-08-11 11:50:29 -0400 |
commit | 541cd939aa3bfb8726f2e51d28ab3145059a676d (patch) | |
tree | 5b51d83c1c656466e7a4c7226fd6a4a0edf24357 /client/src/leap/soledad | |
parent | cb92f58a141f410739ae6460b7eb8aaf2daa3c65 (diff) |
[feat] emit a dict instead of a str
Diffstat (limited to 'client/src/leap/soledad')
-rw-r--r-- | client/src/leap/soledad/client/http_target.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/client/src/leap/soledad/client/http_target.py b/client/src/leap/soledad/client/http_target.py index 31729e2c..19ebd82f 100644 --- a/client/src/leap/soledad/client/http_target.py +++ b/client/src/leap/soledad/client/http_target.py @@ -310,11 +310,12 @@ class SoledadHTTPSyncTarget(SyncTarget): if self._defer_encryption: self._sync_enc_pool.delete_encrypted_doc( doc.doc_id, doc.rev) + msg = "%d/%d" % (idx, total) - emit( - SOLEDAD_SYNC_SEND_STATUS, - "Soledad sync send status: %s" % msg) + content = {'sent': idx, 'total': total} + emit(SOLEDAD_SYNC_SEND_STATUS, content) logger.debug("Sync send status: %s" % msg) + response_dict = json.loads(result)[0] gen_after_send = response_dict['new_generation'] trans_id_after_send = response_dict['new_transaction_id'] @@ -506,7 +507,8 @@ class SoledadHTTPSyncTarget(SyncTarget): # ------------------------------------------------------------- self._received_docs += 1 msg = "%d/%d" % (self._received_docs, total) - emit(SOLEDAD_SYNC_RECEIVE_STATUS, msg) + content = {'received': self._received_docs, 'total': total} + emit(SOLEDAD_SYNC_RECEIVE_STATUS, content) logger.debug("Sync receive status: %s" % msg) return number_of_changes, new_generation, new_transaction_id |