diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2015-12-12 18:36:04 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2015-12-13 10:22:59 +0100 |
commit | 8f870cc5f4e4810e3fdb2346275a2d7f7e3e91e0 (patch) | |
tree | c09b9962a830f5bcda05481e59efd8a220c3c133 /scripts | |
parent | e45609cf6645e650b8bafccd6860dec6aa9bb547 (diff) | |
download | aur-8f870cc5f4e4810e3fdb2346275a2d7f7e3e91e0.tar.gz aur-8f870cc5f4e4810e3fdb2346275a2d7f7e3e91e0.tar.xz |
notify: Do not break overly long words
Fixes FS#46937.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/notify.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/notify.py b/scripts/notify.py index 9a9cc299..b5bf518b 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') |