From 73484268394afb3605a135981214e749f0a920ab Mon Sep 17 00:00:00 2001 From: drebs Date: Thu, 3 Jan 2013 17:16:19 -0200 Subject: LeapDatabase passes HTTPDatabase tests. --- backends/leap_backend.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'backends/leap_backend.py') diff --git a/backends/leap_backend.py b/backends/leap_backend.py index ced8734c..a79fc9e7 100644 --- a/backends/leap_backend.py +++ b/backends/leap_backend.py @@ -8,6 +8,8 @@ from u1db.remote.http_target import HTTPSyncTarget from u1db.remote.http_database import HTTPDatabase from leap.soledad.util import GPGWrapper +import uuid + class NoDefaultKey(Exception): pass @@ -70,6 +72,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 -- cgit v1.2.3