From 77f01091a4c807e069f5f1114e7036b432812fba Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Thu, 11 Feb 2010 17:13:33 +0100 Subject: [PATCH] better linewrapping and output of umlauts --- osc/core.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/osc/core.py b/osc/core.py index d1ba8a52..2aab186b 100644 --- a/osc/core.py +++ b/osc/core.py @@ -1609,7 +1609,17 @@ class Request: who.reverse() ret += "\n From: %s" % (' -> '.join(who)) if self.descr: - ret += "\n Descr: %s" % (repr(self.descr)) + txt = re.sub(r'[^[:isprint:]]', '_', self.descr) + import textwrap + lines = txt.splitlines() + wrapper = textwrap.TextWrapper( width = 80, + initial_indent=' Descr: ', + subsequent_indent=' ') + ret += "\n" + wrapper.fill(lines[0]) + wrapper.initial_indent = ' ' + for line in lines[1:]: + ret += "\n" + wrapper.fill(line) + ret += "\n" return ret