mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-24 07:01:30 +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,9 +1,9 @@
|
||||
import mimetypes
|
||||
import textwrap
|
||||
import urllib.parse
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from ebook_converter import guess_type
|
||||
from ebook_converter.utils.imghdr import identify
|
||||
from ebook_converter.polyglot.urllib import unquote
|
||||
|
||||
@@ -115,7 +115,7 @@ class CoverManager(object):
|
||||
else self.svg_template
|
||||
tp = templ % unquote(href)
|
||||
id, href = m.generate('titlepage', 'titlepage.xhtml')
|
||||
item = m.add(id, href, guess_type('t.xhtml')[0],
|
||||
item = m.add(id, href, mimetypes.guess_type('t.xhtml')[0],
|
||||
data=etree.fromstring(tp))
|
||||
else:
|
||||
key = urllib.parse.urldefrag(self.oeb.guide['titlepage'].href)[0]
|
||||
|
||||
Reference in New Issue
Block a user