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

Cleaned up cover module

This commit is contained in:
2020-07-05 16:37:03 +02:00
parent 8bb1168969
commit 111854f686
7 changed files with 105 additions and 756 deletions
+6 -2
View File
@@ -1,3 +1,4 @@
import logging
import re
from lxml import etree
@@ -13,6 +14,10 @@ RECOVER_PARSER = etree.XMLParser(recover=True, no_network=True,
resolve_entities=False)
# TODO(gryf): replace this with real logging setup.
LOG = logging
class NotHTML(Exception):
def __init__(self, root_tag):
@@ -152,8 +157,7 @@ def check_for_html5(prefix, root):
def parse_html(data, log=None, decoder=None, preprocessor=None,
filename='<string>', non_html_file_tags=frozenset()):
if log is None:
from ebook_converter.utils.logging import default_log
log = default_log
log = LOG
filename = force_unicode(filename, enc=filesystem_encoding)