Improved debug output for task added
Improved handling of calibre output on windows
This commit is contained in:
parent
92f65882b2
commit
021298374e
|
@ -217,13 +217,16 @@ class TaskConvert(CalibreTask):
|
||||||
quotes.append(quotes_index)
|
quotes.append(quotes_index)
|
||||||
quotes_index += 1
|
quotes_index += 1
|
||||||
|
|
||||||
p = process_open(command, quotes)
|
p = process_open(command, quotes, newlines=False)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
return 1, _(u"Ebook-converter failed: %(error)s", error=e)
|
return 1, _(u"Ebook-converter failed: %(error)s", error=e)
|
||||||
|
|
||||||
while p.poll() is None:
|
while p.poll() is None:
|
||||||
nextline = p.stdout.readline()
|
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
|
# parse progress string from calibre-converter
|
||||||
progress = re.search(r"(\d+)%\s.*", nextline)
|
progress = re.search(r"(\d+)%\s.*", nextline)
|
||||||
if progress:
|
if progress:
|
||||||
|
@ -244,3 +247,6 @@ class TaskConvert(CalibreTask):
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
return "Convert"
|
return "Convert"
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return "Convert {} {}".format(self.bookid, self.kindle_mail)
|
||||||
|
|
|
@ -267,4 +267,4 @@ class TaskEmail(CalibreTask):
|
||||||
return "E-mail"
|
return "E-mail"
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "{}, {}".format(self.name, self.subject)
|
return "E-mail {}, {}".format(self.name, self.subject)
|
||||||
|
|
|
@ -32,3 +32,6 @@ class TaskUpload(CalibreTask):
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
return "Upload"
|
return "Upload"
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return "Upload {}".format(self.message)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user