summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2018-03-26 17:51:34 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2018-04-12 14:39:45 +0100
commitec180e7a96dc14a8ec36cdfc07edf8b030d29db5 (patch)
treedd6a280d60a9abb90510c3f36ced2254ce4cddd7
parentb7c015b3c662793c1cbd5b48cd6ef61719367e64 (diff)
downloadbuildstream-ec180e7a96dc14a8ec36cdfc07edf8b030d29db5.tar.gz
frontend: Control indentations of multi-line values
-rw-r--r--buildstream/_frontend/widget.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py
index 7b5ade005..f7af4c614 100644
--- a/buildstream/_frontend/widget.py
+++ b/buildstream/_frontend/widget.py
@@ -658,6 +658,11 @@ class LogLine(Widget):
max_key_len = max(len(key), max_key_len)
for key, value in values.items():
+ if isinstance(value, str) and '\n' in value:
+ text += self.format_profile.fmt(" {}:\n".format(key))
+ text += textwrap.indent(value, self.indent)
+ continue
+
text += self.format_profile.fmt(" {}: {}".format(key, ' ' * (max_key_len - len(key))))
if style_value:
text += self.content_profile.fmt(str(value))