From 3342cc75c8ad63a0a08d1116e0e4b9bc890271a2 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 31 Aug 2015 15:48:23 -0300 Subject: [bug] emit dict instead of str - Resolves: #7412 --- client/changes/bug-7412_sync-status-broken | 1 + client/src/leap/soledad/client/http_target/fetch.py | 4 +++- client/src/leap/soledad/client/http_target/send.py | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 client/changes/bug-7412_sync-status-broken diff --git a/client/changes/bug-7412_sync-status-broken b/client/changes/bug-7412_sync-status-broken new file mode 100644 index 00000000..b6800bc5 --- /dev/null +++ b/client/changes/bug-7412_sync-status-broken @@ -0,0 +1 @@ +o Fix refactor code loss. Closes #7412. diff --git a/client/src/leap/soledad/client/http_target/fetch.py b/client/src/leap/soledad/client/http_target/fetch.py index d38ecb19..34d7cb0b 100644 --- a/client/src/leap/soledad/client/http_target/fetch.py +++ b/client/src/leap/soledad/client/http_target/fetch.py @@ -244,6 +244,8 @@ class HTTPDocFetcher(object): def _emit_receive_status(received_docs, total): + content = {'received': received_docs, 'total': total} + emit(SOLEDAD_SYNC_RECEIVE_STATUS, content) + msg = "%d/%d" % (received_docs, total) - emit(SOLEDAD_SYNC_RECEIVE_STATUS, msg) logger.debug("Sync receive status: %s" % msg) diff --git a/client/src/leap/soledad/client/http_target/send.py b/client/src/leap/soledad/client/http_target/send.py index 72c33c6c..71157da5 100644 --- a/client/src/leap/soledad/client/http_target/send.py +++ b/client/src/leap/soledad/client/http_target/send.py @@ -95,8 +95,8 @@ class HTTPDocSender(object): def _emit_send_status(idx, total): + content = {'sent': idx, 'total': total} + emit(SOLEDAD_SYNC_SEND_STATUS, content) + msg = "%d/%d" % (idx, total) - emit( - SOLEDAD_SYNC_SEND_STATUS, - "Soledad sync send status: %s" % msg) logger.debug("Sync send status: %s" % msg) -- cgit v1.2.3