summaryrefslogtreecommitdiff
path: root/leap.py
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
commit971f0cbdd4eba31b3107c8505cdc2e75809a9b5d (patch)
treea64f35822c4ddc14a17606383afbf05a75d03dd5 /leap.py
parent269fb7e485de11233d389dbe2d33efca8b5b6600 (diff)
Add LeapDatabase that uses LeapSyncTarget.
Diffstat (limited to 'leap.py')
-rw-r--r--leap.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/leap.py b/leap.py
index 46f95a1a..e81c6b0c 100644
--- a/leap.py
+++ b/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):