IGN:Handle HTML files containing only an image in html2lrf. Fixe regression that was causing jobs that failed in the GUI to be marked successfull

This commit is contained in:
Kovid Goyal 2008-09-12 14:43:55 -07:00
parent fdf4c4342f
commit f7bf112ae2
2 changed files with 7 additions and 4 deletions

View File

@ -540,7 +540,7 @@ class HTMLConverter(object, LoggingInterface):
return tb
for page in list(self.book.pages()[index+1:]):
for c in page.contents:
if isinstance(c, (TextBlock, ImageBlock)):
if isinstance(c, (TextBlock, ImageBlock, Canvas)):
return c
raise ConversionError(_('Could not parse file: %s')%self.file_name)

View File

@ -466,7 +466,9 @@ class Overseer(object):
self.job.update_status(percent, msg)
elif word == 'ERROR':
self.write('OK')
self.job.excetion, self.job.traceback = cPickle.loads(msg)
exception, traceback = cPickle.loads(msg)
self.job.output(u'%s\n%s'%(exception, traceback))
self.job.exception, self.job.traceback = exception, traceback
return True
else:
self.terminate()
@ -914,10 +916,11 @@ def worker(host, port):
write(client_socket, 'RESULT:'+ cPickle.dumps(result))
except BaseException, err:
exception = (err.__class__.__name__, unicode(str(err), 'utf-8', 'replace'))
tb = traceback.format_exc()
tb = unicode(traceback.format_exc(), 'utf-8', 'replace')
msg = 'ERROR:'+cPickle.dumps((exception, tb),-1)
write(client_socket, msg)
if read(client_socket, 10) != 'OK':
res = read(client_socket, 10)
if res != 'OK':
break
gc.collect()
elif msg == 'PING:':