Merge from trunk

This commit is contained in:
Charles Haley 2012-06-10 10:04:26 +02:00
commit 0ec404bce2
8 changed files with 57 additions and 52 deletions

View File

@ -5,11 +5,11 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe):
timefmt = ''
__author__ = 'Dave Asbury'
cover_url = 'http://1.bp.blogspot.com/_GwWyq5eGw9M/S9BHPHxW55I/AAAAAAAAB6Q/iGCWl0egGzg/s320/Birmingham+post+Lite+front.JPG'
oldest_article = 1
max_articles_per_feed = 20
oldest_article = 2
max_articles_per_feed = 12
remove_empty_feeds = True
remove_javascript = True
auto_cleanup = True
#auto_cleanup = True
language = 'en_GB'
@ -17,9 +17,12 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe):
keep_only_tags = [
#dict(name='h1',attrs={'id' : 'article-headline'}),
#dict(attrs={'class':['article-meta-author','article-meta-date','article main','art-o art-align-center otm-1 ']}),
#dict(name='p')
dict(name='h1',attrs={'id' : 'article-headline'}),
dict(attrs={'class':['article-meta-author','article-meta-date','article main','art-o art-align-center otm-1 ']}),
dict(name='div',attrs={'class' : 'article-image full'}),
dict(attrs={'clas' : 'art-o art-align-center otm-1 '}),
dict(name='div',attrs={'class' : 'article main'}),
#dict(name='p')
#dict(attrs={'id' : 'three-col'})
]
remove_tags = [
@ -28,7 +31,7 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe):
]
feeds = [
#(u'News',u'http://www.birminghampost.net/news/rss.xml'),
(u'Local News', u'http://www.birminghampost.net/news/west-midlands-news/rss.xml'),
(u'West Mids. News', u'http://www.birminghampost.net/news/west-midlands-news/rss.xml'),
(u'UK News', u'http://www.birminghampost.net/news/uk-news/rss.xml'),
(u'Sports',u'http://www.birminghampost.net/midlands-birmingham-sport/rss.xml'),
(u'Bloggs & Comments',u'http://www.birminghampost.net/comment/rss.xml')

View File

@ -1,6 +1,6 @@
__license__ = 'GPL v3'
__copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
__copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>, 2012 Bernd Leinfelder <skoll1975@gmail.com>'
'''
www.nzz.ch
@ -10,7 +10,7 @@ from calibre.web.feeds.recipes import BasicNewsRecipe
class Nzz(BasicNewsRecipe):
title = 'NZZ Online'
__author__ = 'Darko Miletic'
__author__ = 'Darko Miletic, Bernd Leinfelder'
description = 'Laufend aktualisierte Nachrichten, Analysen und Hintergruende zu Politik, Wirtschaft, Kultur und Sport'
publisher = 'NZZ AG'
category = 'news, politics, nachrichten, Switzerland'
@ -41,31 +41,31 @@ class Nzz(BasicNewsRecipe):
,'publisher' : publisher
}
keep_only_tags = [dict(name='div', attrs={'class':'zone'})]
remove_tags_before = dict(name='p', attrs={'class':'dachzeile'})
remove_tags_after=dict(name='p', attrs={'class':'fussnote'})
remove_attributes=['width','height','lang']
remove_tags_before = dict(id='main')
remove_tags_after = dict(id='articleBodyText')
remove_tags = [
dict(name=['object','link','base','meta','iframe'])
,dict(attrs={'id':'content_rectangle_1'})
,dict(attrs={'class':['weiterfuehrendeLinks','fussnote','video']})
,dict(id='social-media-floater')
,dict(name='div',attrs={'class':['box']})
]
feeds = [
(u'International' , u'http://www.nzz.ch/nachrichten/international?rss=true')
,(u'Schweiz' , u'http://www.nzz.ch/nachrichten/schweiz?rss=true')
,(u'Wirtschaft' , u'http://www.nzz.ch/nachrichten/wirtschaft/aktuell?rss=true')
,(u'Finanzmaerkte' , u'http://www.nzz.ch/finanzen/nachrichten?rss=true')
,(u'Zuerich' , u'http://www.nzz.ch/nachrichten/zuerich?rss=true')
,(u'Sport' , u'http://www.nzz.ch/nachrichten/sport?rss=true')
,(u'Panorama' , u'http://www.nzz.ch/nachrichten/panorama?rss=true')
,(u'Kultur' , u'http://www.nzz.ch/nachrichten/kultur/aktuell?rss=true')
,(u'Wissenschaft' , u'http://www.nzz.ch/nachrichten/wissenschaft?rss=true')
,(u'Medien' , u'http://www.nzz.ch/nachrichten/medien?rss=true')
,(u'Reisen' , u'http://www.nzz.ch/magazin/reisen?rss=true')
(u'International' , u'http://www.nzz.ch/aktuell/international.rss')
,(u'Schweiz' , u'http://www.nzz.ch/aktuell/schweiz.rss')
,(u'Wirtschaft' , u'http://www.nzz.ch/aktuell/wirtschaft/uebersicht.rss')
,(u'Finanzmaerkte' , u'http://www.nzz.ch/finanzen/uebersicht/finanznachrichten.rss')
,(u'Zuerich' , u'http://www.nzz.ch/aktuell/zuerich/uebersicht.rss')
,(u'Sport' , u'http://www.nzz.ch/aktuell/sport/uebersicht.rss')
,(u'Panorama' , u'http://www.nzz.ch/aktuell/panorama.rss')
,(u'Kultur' , u'http://www.nzz.ch/aktuell/feuilleton/uebersicht.rss')
,(u'Wissenschaft' , u'http://www.nzz.ch/wissen/uebersicht.rss')
,(u'Reisen' , u'http://www.nzz.ch/lebensart/reisen-freizeit.rss')
,(u'Auto Mobil' , u'http://www.nzz.ch/lebensart/auto-mobil.rss')
,(u'Digital' , u'http://www.nzz.ch/lebensart/digital.rss')
,(u'Stil' , u'http://www.nzz.ch/lebensart/stil.rss')
,(u'Wein-Keller' , u'http://www.nzz.ch/lebensart/wein-keller.rss')
]
def preprocess_html(self, soup):
for item in soup.findAll(style=True):
del item['style']
return self.adeify_images(soup)

View File

@ -442,12 +442,6 @@ metadata_edit_custom_column_order = []
# calibre.
public_smtp_relay_delay = 301
#: Remove the bright yellow lines at the edges of the book list
# Control whether the bright yellow lines at the edges of book list are drawn
# when a section of the user interface is hidden. Changes will take effect
# after a restart of calibre.
draw_hidden_section_indicators = True
#: The maximum width and height for covers saved in the calibre library
# All covers in the calibre library will be resized, preserving aspect ratio,
# to fit within this size. This is to prevent slowdowns caused by extremely

View File

@ -238,10 +238,11 @@ class LayoutMixin(object): # {{{
# }}}
self.status_bar = StatusBar(self)
stylename = unicode(self.style().objectName())
for x in button_order:
button = getattr(self, x+'_splitter').button
button.setIconSize(QSize(24, 24))
if isosx:
if isosx and stylename != u'Calibre':
button.setStyleSheet('''
QToolButton { background: none; border:none; padding: 0px; }
QToolButton:checked { background: rgba(0, 0, 0, 25%); }

View File

@ -183,10 +183,17 @@ Author matching is exact.</string>
</item>
<item row="5" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Ignore files with the following extensions when automatically adding </string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Ignore files with the following extensions when automatically adding </string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="opt_blocked_auto_formats">
<property name="alternatingRowColors">

View File

@ -210,7 +210,7 @@ to be shown as user categories</string>
<item row="0" column="0" colspan="4">
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;p&gt;When you search for similar books by author, series, etc,
<string>&lt;p&gt;When you search for similar books by right clicking the book and selecting "Similar books...",
calibre constructs a search using the column lookup names defined below.
By changing the lookup name to a grouped search term you can
search multiple columns.&lt;/p&gt;</string>

View File

@ -25,13 +25,19 @@ class TagDelegate(QStyledItemDelegate): # {{{
def paint(self, painter, option, index):
item = index.data(Qt.UserRole).toPyObject()
QStyledItemDelegate.paint(self, painter, option, index)
widget = self.parent()
style = QApplication.style() if widget is None else widget.style()
self.initStyleOption(option, index)
if item.boxed:
r = style.subElementRect(style.SE_ItemViewItemFocusRect, option,
widget)
painter.save()
painter.drawLine(r.bottomLeft(), r.bottomRight())
painter.restore()
if item.type != TagTreeItem.TAG:
return
if (item.tag.state == 0 and config['show_avg_rating'] and
item.tag.avg_rating is not None):
self.initStyleOption(option, index)
widget = self.parent()
style = QApplication.style() if widget is None else widget.style()
r = style.subElementRect(style.SE_ItemViewItemDecoration,
option, widget)
icon = option.icon
@ -48,6 +54,7 @@ class TagDelegate(QStyledItemDelegate): # {{{
icon.On)
painter.restore()
# }}}
class TagsView(QTreeView): # {{{

View File

@ -21,7 +21,7 @@ from calibre.gui2 import (NONE, error_dialog, pixmap_to_data, gprefs,
from calibre.gui2.filename_pattern_ui import Ui_Form
from calibre import fit_image
from calibre.ebooks import BOOK_EXTENSIONS
from calibre.utils.config import prefs, XMLConfig, tweaks
from calibre.utils.config import prefs, XMLConfig
from calibre.gui2.progress_indicator import ProgressIndicator as _ProgressIndicator
from calibre.gui2.dnd import (dnd_has_image, dnd_get_image, dnd_get_files,
IMAGE_EXTENSIONS, dnd_has_extension, DownloadDialog)
@ -1000,13 +1000,6 @@ class SplitterHandle(QSplitterHandle):
if oh != self.highlight:
self.update()
def paintEvent(self, ev):
QSplitterHandle.paintEvent(self, ev)
if self.highlight and tweaks['draw_hidden_section_indicators']:
painter = QPainter(self)
painter.setClipRect(ev.rect())
painter.fillRect(self.rect(), Qt.yellow)
def mouseDoubleClickEvent(self, ev):
self.double_clicked.emit(self)