summaryrefslogtreecommitdiff
path: root/backends/leap_backend.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-02-09 22:23:10 -0200
committerdrebs <drebs@leap.se>2013-02-09 22:23:10 -0200
commitac99a63c702fcca5b102a2e4e04416871c83347c (patch)
treefe82c93ef64f48cd7e40e7636e0afb12c6e6cc74 /backends/leap_backend.py
parent2a1f96729fb694257cab220022ea81731133dca6 (diff)
Remove LeapDatabase because we don't need it (LeapSyncTarget does the job).
Diffstat (limited to 'backends/leap_backend.py')
-rw-r--r--backends/leap_backend.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/backends/leap_backend.py b/backends/leap_backend.py
index a2208404..c0a22feb 100644
--- a/backends/leap_backend.py
+++ b/backends/leap_backend.py
@@ -86,44 +86,6 @@ class LeapDocument(Document):
doc="Wrapper to ensure `doc.rev` is always returned as bytes.")
-class LeapDatabase(HTTPDatabase):
- """Implement the HTTP remote database API to a Leap server."""
-
- def __init__(self, url, document_factory=None, creds=None, soledad=None):
- super(LeapDatabase, self).__init__(url, creds=creds)
- self._soledad = soledad
-
- # wrap soledad in factory
- def factory(doc_id=None, rev=None, json='{}', has_conflicts=False,
- encrypted_json=None, syncable=True):
- return LeapDocument(doc_id=doc_id, rev=rev, json=json,
- has_conflicts=has_conflicts,
- encrypted_json=encrypted_json,
- syncable=syncable, soledad=self._soledad)
- self.set_document_factory(factory)
-
- @staticmethod
- def open_database(url, create):
- db = LeapDatabase(url)
- db.open(create)
- return db
-
- @staticmethod
- def delete_database(url):
- db = LeapDatabase(url)
- db._delete()
- db.close()
-
- def _allocate_doc_id(self):
- """Generate a unique identifier for this document."""
- return 'D-' + uuid.uuid4().hex # 'D-' stands for document
-
- def get_sync_target(self):
- st = LeapSyncTarget(self._url.geturl())
- st._creds = self._creds
- return st
-
-
class LeapSyncTarget(HTTPSyncTarget):
"""
A SyncTarget that encrypts data before sending and decrypts data after