little refactoring for send emails through gmail account

This commit is contained in:
Ozzieisaacs 2022-10-04 20:48:09 +02:00
parent 8ba23ac3ee
commit 3d59a78c9f

View File

@ -164,7 +164,6 @@ class TaskEmail(CalibreTask):
self.send_standard_email(msg) self.send_standard_email(msg)
else: else:
self.send_gmail_email(msg) self.send_gmail_email(msg)
self._handleSuccess()
except MemoryError as e: except MemoryError as e:
log.error_or_exception(e, stacklevel=3) log.error_or_exception(e, stacklevel=3)
self._handleError(u'MemoryError sending e-mail: {}'.format(str(e))) self._handleError(u'MemoryError sending e-mail: {}'.format(str(e)))
@ -217,7 +216,8 @@ class TaskEmail(CalibreTask):
log.debug("E-mail send successfully") log.debug("E-mail send successfully")
def send_gmail_email(self, message): def send_gmail_email(self, message):
return gmail.send_messsage(self.settings.get('mail_gmail_token', None), message) gmail.send_messsage(self.settings.get('mail_gmail_token', None), message)
self._handleSuccess()
@property @property
def progress(self): def progress(self):