summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2018-03-26 17:48:33 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2018-04-12 14:39:45 +0100
commit144a5cc92456a81da316f9c03dc31d067fc47e06 (patch)
treebbc167319abefee4c1839669c7c8a40e49534762
parent1fafcd0e3ca4e326ce5edc78ff155fbc1b26ecdf (diff)
downloadbuildstream-144a5cc92456a81da316f9c03dc31d067fc47e06.tar.gz
frontend: Use textwrap.indent to indent
The intent is more obvious by using an existing module.
-rw-r--r--buildstream/_frontend/widget.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py
index 924c0318d..4d4f11380 100644
--- a/buildstream/_frontend/widget.py
+++ b/buildstream/_frontend/widget.py
@@ -23,6 +23,7 @@ from collections import defaultdict, OrderedDict
from contextlib import ExitStack
from mmap import mmap
import re
+import textwrap
import click
from ruamel import yaml
@@ -463,7 +464,7 @@ class LogLine(Widget):
text += self.indent + self.err_profile.fmt("=" * 70) + '\n'
log_content = self.read_last_lines(message.logfile)
- log_content = self.indent + self.indent.join(log_content.splitlines(True))
+ log_content = textwrap.indent(log_content, self.indent)
text += self.detail_profile.fmt(log_content)
text += '\n'
text += self.indent + self.err_profile.fmt("=" * 70) + '\n'