diff options
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 = ( |