mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Do not load QtWebkit when running a conversion that does not output to PDF
This commit is contained in:
parent
0600e911f1
commit
55794f2d9d
@ -15,7 +15,6 @@ from calibre.customize.conversion import OutputFormatPlugin, \
|
|||||||
OptionRecommendation
|
OptionRecommendation
|
||||||
from calibre.ebooks.metadata.opf2 import OPF
|
from calibre.ebooks.metadata.opf2 import OPF
|
||||||
from calibre.ptempfile import TemporaryDirectory
|
from calibre.ptempfile import TemporaryDirectory
|
||||||
from calibre.ebooks.pdf.writer import PDFWriter, ImagePDFWriter, PDFMetadata
|
|
||||||
from calibre.ebooks.pdf.pageoptions import UNITS, PAPER_SIZES, \
|
from calibre.ebooks.pdf.pageoptions import UNITS, PAPER_SIZES, \
|
||||||
ORIENTATIONS
|
ORIENTATIONS
|
||||||
|
|
||||||
@ -90,6 +89,7 @@ class PDFOutput(OutputFormatPlugin):
|
|||||||
self.convert_text(oeb_book)
|
self.convert_text(oeb_book)
|
||||||
|
|
||||||
def convert_images(self, images):
|
def convert_images(self, images):
|
||||||
|
from calibre.ebooks.pdf.writer import ImagePDFWriter
|
||||||
self.write(ImagePDFWriter, images)
|
self.write(ImagePDFWriter, images)
|
||||||
|
|
||||||
def get_cover_data(self):
|
def get_cover_data(self):
|
||||||
@ -105,6 +105,7 @@ class PDFOutput(OutputFormatPlugin):
|
|||||||
self.cover_data = None
|
self.cover_data = None
|
||||||
|
|
||||||
def convert_text(self, oeb_book):
|
def convert_text(self, oeb_book):
|
||||||
|
from calibre.ebooks.pdf.writer import PDFWriter
|
||||||
self.log.debug('Serializing oeb input to disk for processing...')
|
self.log.debug('Serializing oeb input to disk for processing...')
|
||||||
self.get_cover_data()
|
self.get_cover_data()
|
||||||
|
|
||||||
@ -119,6 +120,7 @@ class PDFOutput(OutputFormatPlugin):
|
|||||||
self.write(PDFWriter, [s.path for s in opf.spine])
|
self.write(PDFWriter, [s.path for s in opf.spine])
|
||||||
|
|
||||||
def write(self, Writer, items):
|
def write(self, Writer, items):
|
||||||
|
from calibre.ebooks.pdf.writer import PDFMetadata
|
||||||
writer = Writer(self.opts, self.log, cover_data=self.cover_data)
|
writer = Writer(self.opts, self.log, cover_data=self.cover_data)
|
||||||
|
|
||||||
close = False
|
close = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user