From eb92ad715728d54c08abdea7188bcc3df9189270 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 16 May 2013 21:16:12 +0200 Subject: Printer: indent multiline values correctly --- hostinfo/printer.py | 5 +++++ 1 file changed, 5 insertions(+) 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) -- cgit v1.2.3-1-g7c22