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

View File

@ -436,9 +436,12 @@ class FormatParser(object):
else: else:
self.ungetChar(c) self.ungetChar(c)
def wrap(s, length): def wrap(s, length, break_on_hyphens = False, break_long_words = False):
processed = [] 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 context = None
for chunk in chunks: for chunk in chunks:
if context is not None: if context is not None: