mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
notify: Do not break overly long words
Fixes FS#46937. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
e45609cf66
commit
8f870cc5f4
1 changed files with 4 additions and 2 deletions
|
@ -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')
|
||||||
|
|
Loading…
Add table
Reference in a new issue