This commit is contained in:
Kovid Goyal 2013-12-09 13:42:59 +05:30
parent 158a168b1d
commit 8df0f92750
2 changed files with 3 additions and 2 deletions

View File

@ -17,11 +17,11 @@ class BaseError(object):
HELP = ''
INDIVIDUAL_FIX = ''
level = ERROR
def __init__(self, msg, name, line=None, col=None):
self.msg, self.line, self.col = msg, line, col
self.name = name
self.level = ERROR
def __str__(self):
return '%s:%s (%s, %s):%s' % (self.__class__.__name__, self.name, self.line, self.col, self.msg)

View File

@ -8,7 +8,7 @@ __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
from calibre import as_unicode
from calibre.utils.magick import Image
from calibre.ebooks.oeb.polish.check.base import BaseError
from calibre.ebooks.oeb.polish.check.base import BaseError, WARN
class InvalidImage(BaseError):
@ -24,6 +24,7 @@ class CMYKImage(BaseError):
' colors are specified in the CMYK colorspace. You should convert this image'
' to the RGB colorspace, for maximum compatibility.')
INDIVIDUAL_FIX = _('Convert image to RGB automatically')
level = WARN
def __call__(self, container):
from PyQt4.Qt import QImage