util: wrap at termwidth-2 by default

This commit is contained in:
Martin Geisler 2009-07-16 23:25:25 +02:00
parent a2bda0adf6
commit 607267cbbc

View File

@ -1272,7 +1272,9 @@ def termwidth():
pass
return 80
def wrap(line, hangindent, width=78):
def wrap(line, hangindent, width=None):
if width is None:
width = termwidth() - 2
padding = '\n' + ' ' * hangindent
return padding.join(textwrap.wrap(line, width=width - hangindent))