summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap')
-rwxr-xr-xsrc/leap/bitmask/cli/bitmask_cli.py14
-rw-r--r--src/leap/bitmask/core/mail_services.py4
2 files changed, 15 insertions, 3 deletions
diff --git a/src/leap/bitmask/cli/bitmask_cli.py b/src/leap/bitmask/cli/bitmask_cli.py
index 0c1fe832..e51a41b7 100755
--- a/src/leap/bitmask/cli/bitmask_cli.py
+++ b/src/leap/bitmask/cli/bitmask_cli.py
@@ -194,6 +194,19 @@ def do_print_result(stuff):
print Fore.RED + 'ERROR:' + '%s' % obj['error'] + Fore.RESET
+def do_print_key_list(stuff):
+ obj = json.loads(stuff[0])
+ if obj['error']:
+ do_print_result(stuff)
+ return
+
+ keys = obj['result']
+ print Fore.GREEN
+ for key in keys:
+ print key["fingerprint"] + " " + key['address']
+ print Fore.RESET
+
+
def do_print_key(stuff):
obj = json.loads(stuff[0])
if obj['error']:
@@ -334,6 +347,7 @@ def send_command(cli):
if subargs.list:
data += ['list']
+ cb = do_print_key_list
elif subargs.export:
data += ['export']
diff --git a/src/leap/bitmask/core/mail_services.py b/src/leap/bitmask/core/mail_services.py
index 8e64f997..0dd53189 100644
--- a/src/leap/bitmask/core/mail_services.py
+++ b/src/leap/bitmask/core/mail_services.py
@@ -349,9 +349,7 @@ class KeymanagerService(HookableService):
def do_list_keys(self, userid):
km = self._container.get_instance(userid)
d = km.get_all_keys()
- d.addCallback(
- lambda keys: [
- (key.address, key.fingerprint) for key in keys])
+ d.addCallback(lambda keys: [dict(key) for key in keys])
return d
def do_export(self, userid, address):