diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-19 15:05:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-19 16:15:47 +0000 |
commit | b686174b07bd56af4e5ffaa23c24f27f417fc305 (patch) | |
tree | 1ce335620d99341d94e88c159c0b9b0f6f0de5a0 /deluge/plugins/Notifications/deluge_notifications/core.py | |
parent | Adding debian version 2.0.3-4. (diff) | |
download | deluge-b686174b07bd56af4e5ffaa23c24f27f417fc305.tar.xz deluge-b686174b07bd56af4e5ffaa23c24f27f417fc305.zip |
Merging upstream version 2.1.1 (Closes: #1026291).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/plugins/Notifications/deluge_notifications/core.py')
-rw-r--r-- | deluge/plugins/Notifications/deluge_notifications/core.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/deluge/plugins/Notifications/deluge_notifications/core.py b/deluge/plugins/Notifications/deluge_notifications/core.py index 123f9cf..aa200f9 100644 --- a/deluge/plugins/Notifications/deluge_notifications/core.py +++ b/deluge/plugins/Notifications/deluge_notifications/core.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2009-2010 Pedro Algarvio <pedro@algarvio.me> # @@ -12,8 +11,6 @@ # See LICENSE for more details. # -from __future__ import unicode_literals - import logging import smtplib from email.utils import formatdate @@ -119,7 +116,6 @@ Date: %(date)s message = '\r\n'.join((headers + message).splitlines()) try: - # Python 2.6 server = smtplib.SMTP( self.config['smtp_host'], self.config['smtp_port'], timeout=60 ) @@ -152,7 +148,7 @@ Date: %(date)s try: try: - server.sendmail(self.config['smtp_from'], to_addrs, message) + server.sendmail(self.config['smtp_from'], to_addrs, message.encode()) except smtplib.SMTPException as ex: err_msg = ( _('There was an error sending the notification email: %s') % ex @@ -176,7 +172,7 @@ Date: %(date)s def _on_torrent_finished_event(self, torrent_id): log.debug('Handler for TorrentFinishedEvent called for CORE') torrent = component.get('TorrentManager')[torrent_id] - torrent_status = torrent.get_status({}) + torrent_status = torrent.get_status(['name', 'num_files']) # Email subject = _('Finished Torrent "%(name)s"') % torrent_status message = ( |