1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-10 15:13:35 +02:00

Sorted out mime initialization.

Every mime related function in main __init__.py has a flag check for the
check if initialization has already done. This is nonsense, since it
should be done implicitly early on the converter is starting.

This commit straight the things out, and initialization is done in cli
module.

Also, function guess_type was removed, since it's just a proxy for
mimetypes.guess_type function.
This commit is contained in:
2020-06-14 15:41:18 +02:00
parent b23a59f223
commit 1465e4267f
22 changed files with 94 additions and 112 deletions

View File

@@ -14,7 +14,7 @@ from ebook_converter.ebooks.conversion.preprocess import HTMLPreProcessor
from ebook_converter.ptempfile import PersistentTemporaryDirectory
from ebook_converter.utils.date import parse_date
from ebook_converter.utils.zipfile import ZipFile
from ebook_converter import extract, walk, filesystem_encoding, get_types_map
from ebook_converter import extract, walk, filesystem_encoding
from ebook_converter.constants_old import __version__
@@ -1010,7 +1010,6 @@ OptionRecommendation(name='search_replace',
from ebook_converter.utils.fonts.scanner import font_scanner # noqa
import css_parser, logging
css_parser.log.setLevel(logging.WARN)
get_types_map() # Ensure the mimetypes module is intialized
if self.opts.debug_pipeline is not None:
self.opts.verbose = max(self.opts.verbose, 4)