1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-02-22 01:45:58 +01:00

Convert calibre modules to ebook_converter.

Here is the first batch of modules, which are needed for converting
several formats to LRF. Some of the logic has been change, more cleanups
will follow.
This commit is contained in:
2020-04-11 19:33:43 +02:00
parent 69d2e536c5
commit 0f9792df36
252 changed files with 1925 additions and 2344 deletions

View File

@@ -7,10 +7,10 @@ __docformat__ = 'restructuredtext en'
import os, re, shutil
from os.path import dirname, abspath, relpath as _relpath, exists, basename
from calibre.customize.conversion import OutputFormatPlugin, OptionRecommendation
from calibre import CurrentDir
from calibre.ptempfile import PersistentTemporaryDirectory
from polyglot.builtins import unicode_type
from ebook_converter.customize.conversion import OutputFormatPlugin, OptionRecommendation
from ebook_converter import CurrentDir
from ebook_converter.ptempfile import PersistentTemporaryDirectory
from ebook_converter.polyglot.builtins import unicode_type
def relpath(*args):
@@ -48,10 +48,10 @@ class HTMLOutput(OutputFormatPlugin):
Generate table of contents
'''
from lxml import etree
from polyglot.urllib import unquote
from ebook_converter.polyglot.urllib import unquote
from calibre.ebooks.oeb.base import element
from calibre.utils.cleantext import clean_xml_chars
from ebook_converter.ebooks.oeb.base import element
from ebook_converter.utils.cleantext import clean_xml_chars
with CurrentDir(output_dir):
def build_node(current_node, parent=None):
if parent is None:
@@ -85,10 +85,10 @@ class HTMLOutput(OutputFormatPlugin):
def convert(self, oeb_book, output_path, input_plugin, opts, log):
from lxml import etree
from calibre.utils import zipfile
from ebook_converter.utils import zipfile
from templite import Templite
from polyglot.urllib import unquote
from calibre.ebooks.html.meta import EasyMeta
from ebook_converter.polyglot.urllib import unquote
from ebook_converter.ebooks.html.meta import EasyMeta
# read template files
if opts.template_html_index is not None: