summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-05-16 21:16:12 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-05-16 21:16:12 +0200
commiteb92ad715728d54c08abdea7188bcc3df9189270 (patch)
tree12c00f21f2cbfa9be4ab3e0700019c3f35aa055d
parent05d30e8f305888ceadc2996102b68c2a8afce5af (diff)
downloadtools-eb92ad715728d54c08abdea7188bcc3df9189270.tar.gz
tools-eb92ad715728d54c08abdea7188bcc3df9189270.tar.bz2
tools-eb92ad715728d54c08abdea7188bcc3df9189270.zip
Printer: indent multiline values correctly0.1.5
-rw-r--r--hostinfo/printer.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/hostinfo/printer.py b/hostinfo/printer.py
index 91aee91..430b1f6 100644
--- a/hostinfo/printer.py
+++ b/hostinfo/printer.py
@@ -101,6 +101,11 @@ class Printer:
method = getattr(self, 'print_%s' % key)
method(p, value, filter_key)
except AttributeError:
+ try:
+ value = value.strip().splitlines()
+ except:
+ pass
+
if isinstance(value, list):
for v in value:
p.pprint(v)