|
|
|
@ -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)
|
|
|
|
|