summaryrefslogtreecommitdiff
path: root/client/src/leap
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-03-26 18:59:37 -0300
committerdrebs <drebs@leap.se>2017-04-04 18:27:38 +0200
commit96258086a079d54f0e1349aca41878d93102b822 (patch)
treea171bc5aec3d008b74c2417ef1e1ff47eb66e5ad /client/src/leap
parent26a65d100f91883027c17c219d018461968eda65 (diff)
[feature] add listing to local blob db
Diffstat (limited to 'client/src/leap')
-rw-r--r--client/src/leap/soledad/client/_blobs.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/client/src/leap/soledad/client/_blobs.py b/client/src/leap/soledad/client/_blobs.py
index f9f1515b..e781421e 100644
--- a/client/src/leap/soledad/client/_blobs.py
+++ b/client/src/leap/soledad/client/_blobs.py
@@ -163,6 +163,9 @@ class BlobManager(object):
data = yield self._client.get(uri)
defer.returnValue((yield data.json()))
+ def local_list(self):
+ return self.local.list()
+
@defer.inlineCallbacks
def put(self, doc, size):
fd = doc.blob_fd
@@ -289,6 +292,13 @@ class SQLiteBlobBackend(object):
if result:
defer.returnValue(BytesIO(str(result[0][0])))
+ @defer.inlineCallbacks
+ def list(self):
+ query = 'select blob_id from blobs'
+ result = yield self.dbpool.runQuery(query)
+ if result:
+ defer.returnValue([b_id[0] for b_id in result])
+
def _init_blob_table(conn):
maybe_create = (