diff options
author | NavaL <ayoyo@thoughtworks.com> | 2016-07-24 23:15:01 +0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2016-08-01 10:35:04 +0200 |
commit | ee31239729811c0a386ab34e85309d64859e1ee5 (patch) | |
tree | 09f5f868c763a9d151913ffc3e596a694f119544 /mail/src | |
parent | 2666cb70daf86c9a8cb96e48db70d66845a63d3d (diff) |
[refactor] deprecating u1db, using l2db instead.
To keep compatibility with soledad upgrades. It will namely cause version conflicts
to not be properly handled otherwise.
Diffstat (limited to 'mail/src')
-rw-r--r-- | mail/src/leap/mail/adaptors/soledad.py | 10 | ||||
-rw-r--r-- | mail/src/leap/mail/imap/tests/__init__.py | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/mail/src/leap/mail/adaptors/soledad.py b/mail/src/leap/mail/adaptors/soledad.py index f4af020d..298d0172 100644 --- a/mail/src/leap/mail/adaptors/soledad.py +++ b/mail/src/leap/mail/adaptors/soledad.py @@ -25,7 +25,7 @@ from email import message_from_string from twisted.internet import defer from twisted.python import log from zope.interface import implements -import u1db +from leap.soledad.common import l2db from leap.common.check import leap_assert, leap_assert_type @@ -76,7 +76,7 @@ class SoledadDocumentWrapper(models.DocumentWrapper): deletion. """ # TODO we could also use a _dirty flag (in models) - # TODO add a get_count() method ??? -- that is extended over u1db. + # TODO add a get_count() method ??? -- that is extended over l2db. # We keep a dictionary with DeferredLocks, that will be # unique to every subclass of SoledadDocumentWrapper. @@ -136,7 +136,7 @@ class SoledadDocumentWrapper(models.DocumentWrapper): # want to insert already exists. In this case, putting it # and overwriting the document with that doc_id is the right thing # to do. - failure.trap(u1db.errors.RevisionConflict) + failure.trap(l2db.errors.RevisionConflict) self._doc_id = self.future_doc_id self._future_doc_id = None return self.update(store) @@ -186,7 +186,7 @@ class SoledadDocumentWrapper(models.DocumentWrapper): # during a copy. Instead of catching and ignoring this # error, we should mark them in the copy so there is no attempt to # create/update them. - failure.trap(u1db.errors.RevisionConflict) + failure.trap(l2db.errors.RevisionConflict) logger.debug("Got conflict while putting %s" % doc_id) def delete(self, store): @@ -724,7 +724,7 @@ class MailboxWrapper(SoledadDocumentWrapper): class SoledadIndexMixin(object): """ This will need a class attribute `indexes`, that is a dictionary containing - the index definitions for the underlying u1db store underlying soledad. + the index definitions for the underlying l2db store underlying soledad. It needs to be in the following format: {'index-name': ['field1', 'field2']} diff --git a/mail/src/leap/mail/imap/tests/__init__.py b/mail/src/leap/mail/imap/tests/__init__.py index 5cf60ed2..5aa7364e 100644 --- a/mail/src/leap/mail/imap/tests/__init__.py +++ b/mail/src/leap/mail/imap/tests/__init__.py @@ -11,7 +11,7 @@ code, using twisted.trial, for testing leap_mx. """ import os -import u1db +from leap.soledad.common import l2db from leap.common.testing.basetest import BaseLeapTest @@ -44,9 +44,9 @@ class BaseSoledadIMAPTest(BaseLeapTest): self.db2_file = os.path.join( self.tempdir, "db2.u1db") - self._db1 = u1db.open(self.db1_file, create=True, + self._db1 = l2db.open(self.db1_file, create=True, document_factory=SoledadDocument) - self._db2 = u1db.open(self.db2_file, create=True, + self._db2 = l2db.open(self.db2_file, create=True, document_factory=SoledadDocument) # soledad config info |