summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2012-12-03 14:15:50 -0200
committerdrebs <drebs@leap.se>2012-12-03 14:15:50 -0200
commitaf0e22caca57a04b81f2f74eccdc3599178210c0 (patch)
treee2e94a261259116d68d9c17150c35e3b273a7d92 /src/leap
parentcff9a6ed359f3cfc8ec3e7ad94f159acfc5a4fd8 (diff)
Add LeapDatabase that uses LeapSyncTarget.
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/soledad/leap.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/leap/soledad/leap.py b/src/leap/soledad/leap.py
index 46f95a1a..e81c6b0c 100644
--- a/src/leap/soledad/leap.py
+++ b/src/leap/soledad/leap.py
@@ -42,6 +42,15 @@ class LeapDocument(Document):
return self.set_json(plaintext)
+class LeapDatabase(HTTPDatabase):
+ """Implement the HTTP remote database API to a Leap server."""
+
+ def get_sync_target(self):
+ st = LeapSyncTarget(self._url.geturl())
+ st._creds = self._creds
+ return st
+
+
class LeapSyncTarget(HTTPSyncTarget):
def _parse_sync_stream(self, data, return_doc_cb, ensure_callback=None):