Messages shouldn't wrap links, set defaults for text wrapper.

This commit is contained in:
Guido Tabbernuk 2012-07-24 11:11:16 +03:00 committed by Valentin Lorentz
parent 7e002ed2a2
commit 169392e519
1 changed files with 5 additions and 2 deletions

View File

@ -436,9 +436,12 @@ class FormatParser(object):
else:
self.ungetChar(c)
def wrap(s, length):
def wrap(s, length, break_on_hyphens = False, break_long_words = False):
processed = []
chunks = textwrap.wrap(s, length)
wrapper = textwrap.TextWrapper(width=length)
wrapper.break_long_words = break_long_words
wrapper.break_on_hyphens = break_on_hyphens
chunks = wrapper.wrap(s)
context = None
for chunk in chunks:
if context is not None: