notify: Do not break overly long words

Fixes FS#46937.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2015-12-12 18:36:04 +01:00
parent e45609cf66
commit 8f870cc5f4

View file

@ -36,8 +36,10 @@ def headers_reply(thread_id):
return {'In-Reply-To': thread_id, 'References': thread_id} return {'In-Reply-To': thread_id, 'References': thread_id}
def send_notification(to, subject, body, refs, headers={}): def send_notification(to, subject, body, refs, headers={}):
body = '\n'.join([textwrap.fill(line) for line in body.splitlines()]) wrapped = ''
body += '\n\n' + refs for line in body.splitlines():
wrapped += textwrap.fill(line, break_long_words=False) + '\n'
body = wrapped + '\n' + refs
for recipient in to: for recipient in to:
msg = email.mime.text.MIMEText(body, 'plain', 'utf-8') msg = email.mime.text.MIMEText(body, 'plain', 'utf-8')