summaryrefslogtreecommitdiff
path: root/client/src
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-03-26 20:19:25 -0300
committerdrebs <drebs@leap.se>2017-04-04 18:27:39 +0200
commit626aeb1cc030b71ac2f770fefe063fddd35cc7a5 (patch)
treef5787766c6d056d151e16b9e38d2338b6b21f445 /client/src
parent09abcf5a811e160507bb12a59550aa8fa1c64f40 (diff)
[feature] add list to _blobs cli
Diffstat (limited to 'client/src')
-rw-r--r--client/src/leap/soledad/client/_blobs.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/client/src/leap/soledad/client/_blobs.py b/client/src/leap/soledad/client/_blobs.py
index 81e919af..383917ca 100644
--- a/client/src/leap/soledad/client/_blobs.py
+++ b/client/src/leap/soledad/client/_blobs.py
@@ -378,6 +378,10 @@ def testit(reactor):
'get', help='get blob from local db, get if needed')
parser_get.add_argument('blob_id')
+ # parse list command
+ parser_get = subparsers.add_parser(
+ 'list', help='list local and remote blob ids')
+
# parse arguments
args = parser.parse_args()
@@ -433,6 +437,16 @@ def testit(reactor):
logger.info(":: Result of get: " + fd.getvalue())
logger.info(":: Finished full get: %s" % blob_id)
+ @defer.inlineCallbacks
+ def _list():
+ logger.info(":: Listing local blobs")
+ manager = _manager()
+ local_list = yield manager.local_list()
+ logger.info(":: Local list: %s" % local_list)
+ logger.info(":: Listing remote blobs")
+ remote_list = yield manager.remote_list()
+ logger.info(":: Remote list: %s" % remote_list)
+
if args.action == 'upload':
yield _upload(args.blob_id, args.payload)
elif args.action == 'download':
@@ -441,6 +455,8 @@ def testit(reactor):
yield _put(args.blob_id, args.payload)
elif args.action == 'get':
yield _get(args.blob_id)
+ elif args.action == 'list':
+ yield _list()
if __name__ == '__main__':