From 8f870cc5f4e4810e3fdb2346275a2d7f7e3e91e0 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 12 Dec 2015 18:36:04 +0100 Subject: notify: Do not break overly long words Fixes FS#46937. Signed-off-by: Lukas Fleischer --- scripts/notify.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/notify.py b/scripts/notify.py index 9a9cc29..b5bf518 100755 --- a/scripts/notify.py +++ b/scripts/notify.py @@ -36,8 +36,10 @@ def headers_reply(thread_id): return {'In-Reply-To': thread_id, 'References': thread_id} def send_notification(to, subject, body, refs, headers={}): - body = '\n'.join([textwrap.fill(line) for line in body.splitlines()]) - body += '\n\n' + refs + wrapped = '' + for line in body.splitlines(): + wrapped += textwrap.fill(line, break_long_words=False) + '\n' + body = wrapped + '\n' + refs for recipient in to: msg = email.mime.text.MIMEText(body, 'plain', 'utf-8') -- cgit v1.2.3-54-g00ecf