This commit is contained in:
Kovid Goyal 2014-08-09 09:28:37 +05:30
parent 8ba51d0303
commit 559d3f31f4

View File

@ -11,7 +11,7 @@ from future_builtins import map
from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES
from calibre.ebooks.oeb.polish.utils import guess_type from calibre.ebooks.oeb.polish.utils import guess_type
from calibre.ebooks.oeb.polish.cover import is_raster_image from calibre.ebooks.oeb.polish.cover import is_raster_image
from calibre.ebooks.oeb.polish.check.base import run_checkers from calibre.ebooks.oeb.polish.check.base import run_checkers, WARN
from calibre.ebooks.oeb.polish.check.parsing import ( from calibre.ebooks.oeb.polish.check.parsing import (
check_filenames, check_xml_parsing, check_css_parsing, fix_style_tag, check_filenames, check_xml_parsing, check_css_parsing, fix_style_tag,
check_html_size, check_ids, EmptyFile, check_encoding_declarations) check_html_size, check_ids, EmptyFile, check_encoding_declarations)
@ -45,8 +45,9 @@ def run_checks(container):
errors.extend(run_checkers(check_xml_parsing, html_items)) errors.extend(run_checkers(check_xml_parsing, html_items))
errors.extend(run_checkers(check_raster_images, raster_images)) errors.extend(run_checkers(check_raster_images, raster_images))
if errors: for err in errors:
return errors if err.level > WARN:
return errors
# cssutils is not thread safe # cssutils is not thread safe
for name, mt, raw in stylesheets: for name, mt, raw in stylesheets: