Made long running tasks cancellable. Added cancel button to cancellable tasks in the task list. Added APP_MODE env variable for determining if the app is running in development, test, or production.

This commit is contained in:
mmonkey
2021-09-29 02:40:12 -05:00
parent 26071d4e7a
commit 46205a1f83
20 changed files with 346 additions and 153 deletions
+4 -2
View File
@@ -162,7 +162,6 @@ class TaskEmail(CalibreTask):
log.debug_or_exception(ex)
self._handleError(u'Error sending e-mail: {}'.format(ex))
def send_standard_email(self, msg):
use_ssl = int(self.settings.get('mail_use_ssl', 0))
timeout = 600 # set timeout to 5mins
@@ -218,7 +217,6 @@ class TaskEmail(CalibreTask):
self.asyncSMTP = None
self._progress = x
@classmethod
def _get_attachment(cls, bookpath, filename):
"""Get file as MIMEBase message"""
@@ -260,5 +258,9 @@ class TaskEmail(CalibreTask):
def name(self):
return "E-mail"
@property
def is_cancellable(self):
return False
def __str__(self):
return "{}, {}".format(self.name, self.subject)