summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2015-04-27 15:15:56 -0300
committerdrebs <drebs@leap.se>2015-04-28 21:34:39 -0300
commitc28663169e4bbd724c5f8b55610ee6e2fd008e1b (patch)
treed50cc2694a30ddfebf05b34f2a08c155511a73f5
parent512d744da3e6836020feb5a71d949c5dad23db58 (diff)
[refactor] rename sync callbacks on client api
-rw-r--r--client/src/leap/soledad/client/api.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/client/src/leap/soledad/client/api.py b/client/src/leap/soledad/client/api.py
index ce026cdf..0f29503f 100644
--- a/client/src/leap/soledad/client/api.py
+++ b/client/src/leap/soledad/client/api.py
@@ -647,27 +647,27 @@ class Soledad(object):
# -----------------------------------------------------------------
- def on_sync_done(local_gen):
- soledad_events.signal(
- soledad_events.SOLEDAD_DONE_DATA_SYNC, self.uuid)
- return local_gen
-
sync_url = urlparse.urljoin(self._server_url, 'user-%s' % self.uuid)
d = self._dbsyncer.sync(
sync_url,
creds=self._creds, autocreate=False,
defer_decryption=defer_decryption)
+ def _sync_callback(local_gen):
+ soledad_events.signal(
+ soledad_events.SOLEDAD_DONE_DATA_SYNC, self.uuid)
+ return local_gen
+
# prevent sync failures from crashing the app by adding an errback
# that logs the failure and does not propagate it down the callback
# chain
- def _errback(failure):
+ def _sync_errback(failure):
s = StringIO()
failure.printDetailedTraceback(file=s)
msg = "Soledad exception when syncing!\n" + s.getvalue()
logger.error(msg)
- d.addCallbacks(on_sync_done, _errback)
+ d.addCallbacks(_sync_callback, _sync_errback)
return d
def stop_sync(self):