This commit is contained in:
GRiker 2010-11-27 14:44:35 -07:00
commit 0c82c8d0a8
5 changed files with 17 additions and 15 deletions

View File

Before

Width:  |  Height:  |  Size: 1011 B

After

Width:  |  Height:  |  Size: 1011 B

View File

@ -19,11 +19,11 @@ class TheWokinghamTimes(BasicNewsRecipe):
category = 'news, UK, world' category = 'news, UK, world'
language = 'en_GB' language = 'en_GB'
publication_type = 'newsportal' publication_type = 'newsportal'
extra_css = """ extra_css = """
body{ font-family: Arial,sans-serif } body{ font-family: Arial,sans-serif }
img{display: block; margin-bottom: 0.4em} img{display: block; margin-bottom: 0.4em}
""" """
conversion_options = { conversion_options = {
'comments' : description 'comments' : description
,'tags' : category ,'tags' : category
@ -32,10 +32,10 @@ class TheWokinghamTimes(BasicNewsRecipe):
} }
keep_only_tags = [dict(name='div', attrs={'id':'article-body'})] keep_only_tags = [dict(name='div', attrs={'id':'article-body'})]
remove_tags = [ remove_tags = [
dict(name='div' , attrs={'class':['ad']}) dict(name='div' , attrs={'class':['ad']})
,dict(name=['meta','base','iframe','embed','object']) ,dict(name=['meta','base','iframe','embed','object'])
,dict(name='span' , attrs={'class':'caption small'}) ,dict(name='span' , attrs={'class':'caption small'})
] ]
remove_attributes = ['width','height','lang'] remove_attributes = ['width','height','lang']
@ -55,5 +55,5 @@ class TheWokinghamTimes(BasicNewsRecipe):
item.replaceWith(str) item.replaceWith(str)
else: else:
item.name = 'span' item.name = 'span'
del item['href'] del item['href']
return soup return soup

View File

@ -190,6 +190,10 @@ class BookInfo(QWebView):
self.page().setLinkDelegationPolicy(self.page().DelegateAllLinks) self.page().setLinkDelegationPolicy(self.page().DelegateAllLinks)
self.linkClicked.connect(self.link_activated) self.linkClicked.connect(self.link_activated)
self._link_clicked = False self._link_clicked = False
self.setAttribute(Qt.WA_OpaquePaintEvent, False)
palette = self.palette()
palette.setBrush(QPalette.Base, Qt.transparent)
self.page().setPalette(palette)
def link_activated(self, link): def link_activated(self, link):
self._link_clicked = True self._link_clicked = True
@ -211,15 +215,13 @@ class BookInfo(QWebView):
def _show_data(self, rows, comments): def _show_data(self, rows, comments):
f = QFontInfo(QApplication.font(self.parent())).pixelSize() f = QFontInfo(QApplication.font(self.parent())).pixelSize()
p = unicode(QApplication.palette().color(QPalette.Normal,
QPalette.Window).name())
c = unicode(QApplication.palette().color(QPalette.Normal, c = unicode(QApplication.palette().color(QPalette.Normal,
QPalette.WindowText).name()) QPalette.WindowText).name())
templ = u'''\ templ = u'''\
<html> <html>
<head> <head>
<style type="text/css"> <style type="text/css">
body, td {background-color: %s; font-size: %dpx; color: %s } body, td {background-color: transparent; font-size: %dpx; color: %s }
a { text-decoration: none; color: blue } a { text-decoration: none; color: blue }
</style> </style>
</head> </head>
@ -227,7 +229,7 @@ class BookInfo(QWebView):
%%s %%s
</body> </body>
<html> <html>
'''%(p, f, c) '''%(f, c)
if self.vertical: if self.vertical:
if comments: if comments:
rows += u'<tr><td colspan="2">%s</td></tr>'%comments rows += u'<tr><td colspan="2">%s</td></tr>'%comments

View File

@ -150,7 +150,7 @@ class DBThread(Thread):
detect_types=sqlite.PARSE_DECLTYPES|sqlite.PARSE_COLNAMES) detect_types=sqlite.PARSE_DECLTYPES|sqlite.PARSE_COLNAMES)
self.conn.execute('pragma cache_size=5000') self.conn.execute('pragma cache_size=5000')
encoding = self.conn.execute('pragma encoding').fetchone()[0] encoding = self.conn.execute('pragma encoding').fetchone()[0]
c_ext_loaded = False #load_c_extensions(self.conn) c_ext_loaded = load_c_extensions(self.conn)
self.conn.row_factory = sqlite.Row if self.row_factory else lambda cursor, row : list(row) self.conn.row_factory = sqlite.Row if self.row_factory else lambda cursor, row : list(row)
self.conn.create_aggregate('concat', 1, Concatenate) self.conn.create_aggregate('concat', 1, Concatenate)
if not c_ext_loaded: if not c_ext_loaded:

View File

@ -4,9 +4,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: calibre 0.7.30\n" "Project-Id-Version: calibre 0.7.31\n"
"POT-Creation-Date: 2010-11-26 10:43+MST\n" "POT-Creation-Date: 2010-11-27 11:31+MST\n"
"PO-Revision-Date: 2010-11-26 10:43+MST\n" "PO-Revision-Date: 2010-11-27 11:31+MST\n"
"Last-Translator: Automatically generated\n" "Last-Translator: Automatically generated\n"
"Language-Team: LANGUAGE\n" "Language-Team: LANGUAGE\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"