mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-18 12:03:33 +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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user