1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-07 21:43:31 +02:00

Initialize mime in cli module

This commit is contained in:
2020-09-30 20:46:01 +02:00
parent e213b7a64b
commit 847e133878
2 changed files with 4 additions and 16 deletions

View File

@@ -1,8 +1,6 @@
import html
import math
import mimetypes
import os
import pkg_resources
import re
from functools import partial
@@ -11,18 +9,6 @@ from ebook_converter import constants_old
from ebook_converter.ebooks.html_entities import html5_entities
def init_mimetypes():
mimetypes.init([pkg_resources.resource_filename('ebook_converter',
'data/mime.types')])
def guess_extension(*args, **kwargs):
ext = mimetypes.guess_extension(*args, **kwargs)
if not ext and args and args[0] == 'application/x-palmreader':
ext = '.pdb'
return ext
def sanitize_file_name(name, substitute='_'):
"""
Sanitize the filename `name`. All invalid characters are replaced by