summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2018-03-26 17:48:33 +0100
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-04-12 18:03:09 +0000
commit30af44e86bbf44df91fa2acf63da1e70ced33257 (patch)
tree62e3e3db401295e25b83f86bf88e622e06697fce
parent7c9713add0a36cfceb3492e4a008f7e5baba36ab (diff)
downloadbuildstream-30af44e86bbf44df91fa2acf63da1e70ced33257.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'