changeset 2710:b6e16a89311b

jp (info/disco): better default output for extensions
author Goffi <goffi@goffi.org>
date Sat, 01 Dec 2018 14:35:28 +0100
parents 46f2733a2a9b
children 9adf44996e58
files sat_frontends/jp/cmd_info.py
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_info.py	Sat Dec 01 14:34:55 2018 +0100
+++ b/sat_frontends/jp/cmd_info.py	Sat Dec 01 14:35:28 2018 +0100
@@ -103,9 +103,17 @@
                 data_keys = data.keys()
                 data_keys.sort()
                 for key in data_keys:
-                    field_lines.append(A.color(u'\t', C.A_SUBHEADER, key, data[key]))
-                for value in values:
-                    field_lines.append(A.color(u'\t', A.BOLD, value))
+                    field_lines.append(A.color(u'\t', C.A_SUBHEADER, key, A.RESET, u': ',
+                                               data[key]))
+                if len(values) == 1:
+                    field_lines.append(A.color(u'\t', C.A_SUBHEADER, u"value", A.RESET,
+                                               u': ', values[0] or (A.BOLD + u"UNSET")))
+                elif len(values) > 1:
+                    field_lines.append(A.color(u'\t', C.A_SUBHEADER, u"values", A.RESET,
+                                               u': '))
+
+                    for value in values:
+                        field_lines.append(A.color(u'\t  - ', A.BOLD, value))
                 fields.append(u'\n'.join(field_lines))
             extensions_tpl.append(u'{type_}\n{fields}'.format(type_=type_,
                                                               fields='\n\n'.join(fields)))