summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2012-12-03 14:48:44 -0200
committerdrebs <drebs@leap.se>2012-12-03 14:48:44 -0200
commit2812f05c7997766a0527628877a28efd39e0ff1c (patch)
tree6eb46b20fac8614474336342502d7f31c138307b /src/leap
parentaf0e22caca57a04b81f2f74eccdc3599178210c0 (diff)
LeapDatabase can statically open an delete dbs.
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/soledad/leap.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/leap/soledad/leap.py b/src/leap/soledad/leap.py
index e81c6b0c..c9243587 100644
--- a/src/leap/soledad/leap.py
+++ b/src/leap/soledad/leap.py
@@ -45,6 +45,18 @@ class LeapDocument(Document):
class LeapDatabase(HTTPDatabase):
"""Implement the HTTP remote database API to a Leap server."""
+ @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 get_sync_target(self):
st = LeapSyncTarget(self._url.geturl())
st._creds = self._creds