mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-03-05 16:45:48 +01: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:
@@ -11,6 +11,7 @@ from ebook_converter.utils.config import OptionParser
|
||||
from ebook_converter.utils.logging import Log
|
||||
from ebook_converter.customize.conversion import OptionRecommendation
|
||||
from ebook_converter import patheq
|
||||
from ebook_converter import init_mimetypes
|
||||
from ebook_converter.utils.localization import localize_user_manual_link
|
||||
|
||||
|
||||
@@ -361,6 +362,7 @@ def read_sr_patterns(path, log=None):
|
||||
|
||||
def main(args=sys.argv):
|
||||
log = Log()
|
||||
init_mimetypes()
|
||||
parser, plumber = create_option_parser(args, log)
|
||||
opts, leftover_args = parser.parse_args(args)
|
||||
if len(leftover_args) > 3:
|
||||
|
||||
Reference in New Issue
Block a user