diff --git a/cps/tasks/convert.py b/cps/tasks/convert.py index ada53005..004faec8 100644 --- a/cps/tasks/convert.py +++ b/cps/tasks/convert.py @@ -217,13 +217,16 @@ class TaskConvert(CalibreTask): quotes.append(quotes_index) quotes_index += 1 - p = process_open(command, quotes) + p = process_open(command, quotes, newlines=False) except OSError as e: return 1, _(u"Ebook-converter failed: %(error)s", error=e) while p.poll() is None: nextline = p.stdout.readline() - log.debug(nextline.strip('\r\n')) + if isinstance(nextline, bytes): + nextline = nextline.decode('utf-8', errors="ignore").strip('\r\n') + if nextline: + log.debug(nextline) # parse progress string from calibre-converter progress = re.search(r"(\d+)%\s.*", nextline) if progress: @@ -244,3 +247,6 @@ class TaskConvert(CalibreTask): @property def name(self): return "Convert" + + def __str__(self): + return "Convert {} {}".format(self.bookid, self.kindle_mail) diff --git a/cps/tasks/mail.py b/cps/tasks/mail.py index 2e95ee98..05b2175f 100644 --- a/cps/tasks/mail.py +++ b/cps/tasks/mail.py @@ -267,4 +267,4 @@ class TaskEmail(CalibreTask): return "E-mail" def __str__(self): - return "{}, {}".format(self.name, self.subject) + return "E-mail {}, {}".format(self.name, self.subject) diff --git a/cps/tasks/upload.py b/cps/tasks/upload.py index 6a341cdd..2a667c28 100644 --- a/cps/tasks/upload.py +++ b/cps/tasks/upload.py @@ -32,3 +32,6 @@ class TaskUpload(CalibreTask): @property def name(self): return "Upload" + + def __str__(self): + return "Upload {}".format(self.message)