summaryrefslogtreecommitdiff
path: root/src/leap/soledad/backends/leap_backend.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2013-01-23 00:31:14 +0900
committerkali <kali@leap.se>2013-01-23 00:31:14 +0900
commit06a1ef47e1719c3987006043fd1aae10e6da5c86 (patch)
tree87df182d2f8bea962b427e2f31211e8be0f31a6b /src/leap/soledad/backends/leap_backend.py
parent54802bf9c53fc32cfcceb23045c5aeb313c19829 (diff)
parent3359370d9ae06ffc0d60930e7f997d2331dc9037 (diff)
Merge branch 'develop' of ssh://leap.se/leap_client into develop
Diffstat (limited to 'src/leap/soledad/backends/leap_backend.py')
-rw-r--r--src/leap/soledad/backends/leap_backend.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/leap/soledad/backends/leap_backend.py b/src/leap/soledad/backends/leap_backend.py
index a8a65eb4..3e859f7c 100644
--- a/src/leap/soledad/backends/leap_backend.py
+++ b/src/leap/soledad/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