mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-28 10:46:15 +01:00
better linewrapping and output of umlauts
This commit is contained in:
parent
68dd680cf3
commit
77f01091a4
12
osc/core.py
12
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
|
||||
|
Loading…
Reference in New Issue
Block a user