Pull from trunk

This commit is contained in:
Kovid Goyal 2009-03-16 18:04:54 -07:00
commit c372526ba9
4 changed files with 7 additions and 3 deletions

View File

@ -19,7 +19,7 @@ from cssutils.css import CSSStyleRule, CSSPageRule, CSSStyleDeclaration, \
CSSValueList, cssproperties
from cssutils.profiles import profiles as cssprofiles
from lxml import etree
from lxml.cssselect import css_to_xpath, ExpressionError
from lxml.cssselect import css_to_xpath, ExpressionError, SelectorSyntaxError
from calibre.ebooks.oeb.base import XHTML, XHTML_NS, CSS_MIME, OEB_STYLES
from calibre.ebooks.oeb.base import XPNSMAP, xpath, urlnormalize
from calibre.ebooks.oeb.profile import PROFILES
@ -159,7 +159,9 @@ class Stylizer(object):
for _, _, cssdict, text, _ in rules:
try:
selector = CSSSelector(text)
except (AssertionError, ExpressionError, etree.XPathSyntaxError):
except (AssertionError, ExpressionError, etree.XPathSyntaxError,\
NameError, # gets thrown on OS X instead of SelectorSyntaxError
SelectorSyntaxError):
continue
for elem in selector(tree):
self.style(elem)._update_cssdict(cssdict)

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

View File

@ -6,7 +6,7 @@ Builtin recipes.
'''
recipe_modules = ['recipe_' + r for r in (
'newsweek', 'atlantic', 'economist', 'portfolio', 'the_register',
'nytimes', 'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj',
'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj',
'wired', 'globe_and_mail', 'smh', 'espn', 'business_week', 'miami_herald',
'ars_technica', 'upi', 'new_yorker', 'irish_times', 'iht', 'lanacion',
'discover_magazine', 'scientific_american', 'new_york_review_of_books',

2
todo
View File

@ -6,3 +6,5 @@
* Use multiprocessing for cpu_count instead of QThread
* Rationalize books table. Add a pubdate column, remove the uri column (and associated support in add_books) and convert series_index to a float.
* Replace single application stuff with Listener from multiprocessing