mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-29 03:06: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()
|
who.reverse()
|
||||||
ret += "\n From: %s" % (' -> '.join(who))
|
ret += "\n From: %s" % (' -> '.join(who))
|
||||||
if self.descr:
|
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"
|
ret += "\n"
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
Reference in New Issue
Block a user