mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-16 02:53:33 +02:00
Removed get_types_map
This commit is contained in:
@@ -43,10 +43,6 @@ def guess_extension(*args, **kwargs):
|
|||||||
return ext
|
return ext
|
||||||
|
|
||||||
|
|
||||||
def get_types_map():
|
|
||||||
return mimetypes.types_map
|
|
||||||
|
|
||||||
|
|
||||||
def to_unicode(raw, encoding='utf-8', errors='strict'):
|
def to_unicode(raw, encoding='utf-8', errors='strict'):
|
||||||
if isinstance(raw, str):
|
if isinstance(raw, str):
|
||||||
return raw
|
return raw
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ Basic support for manipulating OEB 1.x/2.0 content and metadata.
|
|||||||
import collections
|
import collections
|
||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
|
import mimetypes
|
||||||
import numbers
|
import numbers
|
||||||
import operator
|
import operator
|
||||||
import os
|
import os
|
||||||
@@ -20,7 +21,7 @@ from ebook_converter import force_unicode
|
|||||||
from ebook_converter.constants_old import filesystem_encoding, __version__
|
from ebook_converter.constants_old import filesystem_encoding, __version__
|
||||||
from ebook_converter.ebooks.chardet import xml_to_unicode
|
from ebook_converter.ebooks.chardet import xml_to_unicode
|
||||||
from ebook_converter.ebooks.conversion.preprocess import CSSPreProcessor
|
from ebook_converter.ebooks.conversion.preprocess import CSSPreProcessor
|
||||||
from ebook_converter import as_unicode, get_types_map
|
from ebook_converter import as_unicode
|
||||||
from ebook_converter.ebooks.oeb import parse_utils
|
from ebook_converter.ebooks.oeb import parse_utils
|
||||||
from ebook_converter.utils.cleantext import clean_xml_chars
|
from ebook_converter.utils.cleantext import clean_xml_chars
|
||||||
from ebook_converter.utils.short_uuid import uuid4
|
from ebook_converter.utils.short_uuid import uuid4
|
||||||
@@ -257,20 +258,19 @@ def rewrite_links(root, link_repl_func, resolve_base_href=False):
|
|||||||
el.set('style', repl)
|
el.set('style', repl)
|
||||||
|
|
||||||
|
|
||||||
types_map = get_types_map()
|
EPUB_MIME = mimetypes.types_map['.epub']
|
||||||
EPUB_MIME = types_map['.epub']
|
XHTML_MIME = mimetypes.types_map['.xhtml']
|
||||||
XHTML_MIME = types_map['.xhtml']
|
CSS_MIME = mimetypes.types_map['.css']
|
||||||
CSS_MIME = types_map['.css']
|
NCX_MIME = mimetypes.types_map['.ncx']
|
||||||
NCX_MIME = types_map['.ncx']
|
OPF_MIME = mimetypes.types_map['.opf']
|
||||||
OPF_MIME = types_map['.opf']
|
|
||||||
PAGE_MAP_MIME = 'application/oebps-page-map+xml'
|
PAGE_MAP_MIME = 'application/oebps-page-map+xml'
|
||||||
OEB_DOC_MIME = 'text/x-oeb1-document'
|
OEB_DOC_MIME = 'text/x-oeb1-document'
|
||||||
OEB_CSS_MIME = 'text/x-oeb1-css'
|
OEB_CSS_MIME = 'text/x-oeb1-css'
|
||||||
OPENTYPE_MIME = types_map['.otf']
|
OPENTYPE_MIME = mimetypes.types_map['.otf']
|
||||||
GIF_MIME = types_map['.gif']
|
GIF_MIME = mimetypes.types_map['.gif']
|
||||||
JPEG_MIME = types_map['.jpeg']
|
JPEG_MIME = mimetypes.types_map['.jpeg']
|
||||||
PNG_MIME = types_map['.png']
|
PNG_MIME = mimetypes.types_map['.png']
|
||||||
SVG_MIME = types_map['.svg']
|
SVG_MIME = mimetypes.types_map['.svg']
|
||||||
BINARY_MIME = 'application/octet-stream'
|
BINARY_MIME = 'application/octet-stream'
|
||||||
|
|
||||||
XHTML_CSS_NAMESPACE = '@namespace "%s";\n' % const.XHTML_NS
|
XHTML_CSS_NAMESPACE = '@namespace "%s";\n' % const.XHTML_NS
|
||||||
|
|||||||
Reference in New Issue
Block a user