summaryrefslogtreecommitdiff
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
commit3ad9a5a9b6e86f4c40bf7781d1e6e284a570465a (patch)
treee5f321322388a738e850698c53d958e662e87168
parent971f0cbdd4eba31b3107c8505cdc2e75809a9b5d (diff)
LeapDatabase can statically open an delete dbs.
-rw-r--r--leap.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/leap.py b/leap.py
index e81c6b0c..c9243587 100644
--- a/leap.py
+++ b/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