mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-26 01:24:48 +02:00
IGN:Change in cssutils profiles API
This commit is contained in:
parent
1c56b03f95
commit
580497d0ee
2 changed files with 5 additions and 4 deletions
|
|
@ -17,7 +17,8 @@
|
|||
import cssutils
|
||||
from cssutils.css import CSSStyleRule, CSSPageRule, CSSStyleDeclaration, \
|
||||
CSSValueList, cssproperties
|
||||
from cssutils.profiles import profiles as cssprofiles
|
||||
from cssutils.profiles import Profiles
|
||||
cssprofiles = Profiles()
|
||||
from lxml import etree
|
||||
from lxml.cssselect import css_to_xpath, ExpressionError, SelectorSyntaxError
|
||||
from calibre.ebooks.oeb.base import XHTML, XHTML_NS, CSS_MIME, OEB_STYLES
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class _ErrorHandler(object):
|
|||
"""
|
||||
handles all errors and log messages
|
||||
"""
|
||||
def __init__(self, log, defaultloglevel=logging.INFO,
|
||||
def __init__(self, log, defaultloglevel=logging.INFO,
|
||||
raiseExceptions=True):
|
||||
"""
|
||||
inits log if none given
|
||||
|
|
@ -51,7 +51,7 @@ def __init__(self, log, defaultloglevel=logging.INFO,
|
|||
hdlr.setFormatter(formatter)
|
||||
self._log.addHandler(hdlr)
|
||||
self._log.setLevel(defaultloglevel)
|
||||
|
||||
|
||||
self.raiseExceptions = raiseExceptions
|
||||
|
||||
def __getattr__(self, name):
|
||||
|
|
@ -86,7 +86,7 @@ def __handle(self, msg=u'', token=None, error=xml.dom.SyntaxErr,
|
|||
if error and self.raiseExceptions and not neverraise:
|
||||
if isinstance(error, urllib2.HTTPError) or isinstance(error, urllib2.URLError):
|
||||
raise
|
||||
elif issubclass(error, xml.dom.DOMException):
|
||||
elif issubclass(error, xml.dom.DOMException):
|
||||
error.line = line
|
||||
error.col = col
|
||||
# raise error(msg, line, col)
|
||||
|
|
|
|||
Loading…
Reference in a new issue