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:
gryf committed 2020-06-14 15:41:18 +02:00
1 parent b23a59f223
commit 1465e4267f
22 files changed
+94 -112

No files matched your search

+3 -6
View File
@@ -1,12 +1,9 @@
import bisect
import os
import re
import mimetypes
from ebook_converter import guess_type as _guess_type, replace_entities
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
from ebook_converter import replace_entities
def _upper(string):
@@ -14,7 +11,7 @@ def _upper(string):
def guess_type(x):
return _guess_type(x)[0] or 'application/octet-stream'
return mimetypes.guess_type(x)[0] or 'application/octet-stream'
def setup_css_parser_serialization(tab_width=2):