Merge pull request #602 from JackDandy/feature/ChangeEmailNotify

Change improve handling of a bad email notify setting.
This commit is contained in:
JackDandy 2016-01-07 13:52:33 +00:00
commit 3278c29cc6
2 changed files with 8 additions and 6 deletions

View file

@ -107,6 +107,7 @@
* Change to simplify xem id fetching
* Fix issue on Add Existing Shows page where shows were listed that should not have been
* Change get_size helper to also handle files
* Change improve handling of a bad email notify setting
### 0.10.0 (2015-08-06 11:05:00 UTC)

View file

@ -46,7 +46,7 @@ class EmailNotifier:
def notify_snatch(self, ep_name, title='Snatched:'):
"""
Send a notification that an episode was snatched
ep_name: The name of the episode that was snatched
title: The title of the notification (optional)
"""
@ -81,7 +81,7 @@ class EmailNotifier:
def notify_download(self, ep_name, title='Completed:'):
"""
Send a notification that an episode was downloaded
ep_name: The name of the episode that was downloaded
title: The title of the notification (optional)
"""
@ -116,7 +116,7 @@ class EmailNotifier:
def notify_subtitle_download(self, ep_name, lang, title='Downloaded subtitle:'):
"""
Send a notification that an subtitle was downloaded
ep_name: The name of the episode that was downloaded
lang: Subtitle language wanted
"""
@ -176,10 +176,11 @@ class EmailNotifier:
def _sendmail(self, host, port, smtp_from, use_tls, user, pwd, to, msg, smtpDebug=False):
logger.log('HOST: %s; PORT: %s; FROM: %s, TLS: %s, USER: %s, PWD: %s, TO: %s' % (
host, port, smtp_from, use_tls, user, pwd, to), logger.DEBUG)
srv = smtplib.SMTP(host, int(port))
if smtpDebug:
srv.set_debuglevel(1)
try:
srv = smtplib.SMTP(host, int(port))
if smtpDebug:
srv.set_debuglevel(1)
if (use_tls == '1' or use_tls == True) or (len(user) > 0 and len(pwd) > 0):
srv.ehlo()
logger.log('Sent initial EHLO command!', logger.DEBUG)