mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Fix #904
This commit is contained in:
parent
18fa7a316c
commit
54e5380170
@ -9,7 +9,7 @@ from calibre.ebooks.lit.reader import LitReader
|
|||||||
from calibre.ebooks import ConversionError
|
from calibre.ebooks import ConversionError
|
||||||
from calibre.ebooks.lrf.html.convert_from import process_file as html_process_file
|
from calibre.ebooks.lrf.html.convert_from import process_file as html_process_file
|
||||||
from calibre.ebooks.metadata.opf import OPFReader
|
from calibre.ebooks.metadata.opf import OPFReader
|
||||||
from calibre import isosx, __appname__, setup_cli_handlers, iswindows, islinux
|
from calibre import isosx, __appname__, setup_cli_handlers, islinux
|
||||||
|
|
||||||
CLIT = 'clit'
|
CLIT = 'clit'
|
||||||
if isosx and hasattr(sys, 'frameworks_dir'):
|
if isosx and hasattr(sys, 'frameworks_dir'):
|
||||||
@ -42,10 +42,9 @@ def generate_html(pathtolit, logger):
|
|||||||
raise ConversionError, 'Cannot read from ' + pathtolit
|
raise ConversionError, 'Cannot read from ' + pathtolit
|
||||||
tdir = mkdtemp(prefix=__appname__+'_')
|
tdir = mkdtemp(prefix=__appname__+'_')
|
||||||
os.rmdir(tdir)
|
os.rmdir(tdir)
|
||||||
sep = r'\\' if iswindows else os.path.sep
|
cmd = [CLIT, pathtolit, '%s'%(tdir+os.sep)]
|
||||||
cmd = ' '.join([CLIT, '"'+pathtolit+'"', '"%s"'%(tdir+sep,)])
|
logger.debug(repr(cmd))
|
||||||
logger.debug(cmd)
|
p = Popen(cmd, stderr=PIPE, stdout=PIPE)
|
||||||
p = Popen(cmd, shell=True, stderr=PIPE, stdout=PIPE)
|
|
||||||
stdout = p.stdout.read()
|
stdout = p.stdout.read()
|
||||||
err = p.stderr.read()
|
err = p.stderr.read()
|
||||||
logger.info(p.stdout.read())
|
logger.info(p.stdout.read())
|
||||||
|
@ -126,7 +126,7 @@ class ConversionJob(Job):
|
|||||||
def formatted_error(self):
|
def formatted_error(self):
|
||||||
if self.exception is None:
|
if self.exception is None:
|
||||||
return ''
|
return ''
|
||||||
ans = u'<p><b>%s</b>:'%self.exception
|
ans = u'<p><b>%s</b>:'%repr(self.exception)
|
||||||
ans += '<h2>Traceback:</h2><pre>%s</pre>'%self.last_traceback
|
ans += '<h2>Traceback:</h2><pre>%s</pre>'%self.last_traceback
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import os, sys, glob
|
import os, sys, glob
|
||||||
import sipconfig
|
|
||||||
if os.environ.get('PYQT4PATH', None):
|
if os.environ.get('PYQT4PATH', None):
|
||||||
print os.environ['PYQT4PATH']
|
print os.environ['PYQT4PATH']
|
||||||
sys.path.insert(0, os.environ['PYQT4PATH'])
|
sys.path.insert(0, os.environ['PYQT4PATH'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user