From 434d70d01161fa5bb805133934077f01b31dcb8c Mon Sep 17 00:00:00 2001 From: Kload Date: Fri, 15 Mar 2013 18:12:48 +0000 Subject: [PATCH] Listing fix --- yunohost.py | 4 +++- yunohost_user.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/yunohost.py b/yunohost.py index 8859a093..42e062a1 100644 --- a/yunohost.py +++ b/yunohost.py @@ -52,9 +52,11 @@ def pretty_print_dict(d, depth=0): pretty_print_dict(v, depth+1) elif isinstance(v, list): print((" ") * depth + ("%s: " % str(k))) - for value in v: + for key, value in enumerate(v): if isinstance(value, tuple): pretty_print_dict({value[0]: value[1]}, depth+1) + elif isinstance(value, dict): + pretty_print_dict({key: value}, depth+1) else: print((" ") * (depth+1) + "- " +str(value)) else: diff --git a/yunohost_user.py b/yunohost_user.py index d9758572..0eec8225 100644 --- a/yunohost_user.py +++ b/yunohost_user.py @@ -57,7 +57,7 @@ def user_list(fields=None, filter=None, limit=None, offset=None): if 'mailalias' in user: entry['Mail Aliases'] = user['mailalias'] - result_list.append((str(i), entry)) + result_list.append(entry) i += 1 else: raise YunoHostError(167, _("No user found"))