summaryrefslogtreecommitdiff
path: root/backends/leap_backend.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-01-22 10:09:43 -0200
committerdrebs <drebs@leap.se>2013-01-22 10:09:43 -0200
commit3bf11c9109a457ddbeb47524e34a5c1fd97bd27c (patch)
treecae77f65c1b4377d4fd6934139c0074a92d3f121 /backends/leap_backend.py
parent629b4ae10e17ab667a0b7ae9966914ea728da839 (diff)
parent9a487e87aceddbf656f14961356c74cb7a1de146 (diff)
Merge branch 'feature/soledad-api' into develop
Conflicts: src/leap/soledad/__init__.py src/leap/soledad/backends/couch.py src/leap/soledad/backends/leap_backend.py src/leap/soledad/backends/objectstore.py src/leap/soledad/tests/test_couch.py src/leap/soledad/tests/test_logs.py src/leap/soledad/tests/test_sqlcipher.py src/leap/soledad/util.py
Diffstat (limited to 'backends/leap_backend.py')
-rw-r--r--backends/leap_backend.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/backends/leap_backend.py b/backends/leap_backend.py
index a8a65eb4..3e859f7c 100644
--- a/backends/leap_backend.py
+++ b/backends/leap_backend.py
@@ -4,16 +4,19 @@ except ImportError:
import json # noqa
from u1db import Document
+from u1db.remote import utils
from u1db.remote.http_target import HTTPSyncTarget
from u1db.remote.http_database import HTTPDatabase
-import base64 # unused
+from u1db.errors import BrokenSyncStream
+from leap.soledad.util import GPGWrapper
-#from leap.soledad import util # import GPGWrapper # unused
+import uuid
class NoDefaultKey(Exception):
pass
+
class NoSoledadInstance(Exception):
pass
@@ -72,6 +75,10 @@ class LeapDatabase(HTTPDatabase):
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