mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
0ec404bce2
@ -5,11 +5,11 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe):
|
|||||||
timefmt = ''
|
timefmt = ''
|
||||||
__author__ = 'Dave Asbury'
|
__author__ = 'Dave Asbury'
|
||||||
cover_url = 'http://1.bp.blogspot.com/_GwWyq5eGw9M/S9BHPHxW55I/AAAAAAAAB6Q/iGCWl0egGzg/s320/Birmingham+post+Lite+front.JPG'
|
cover_url = 'http://1.bp.blogspot.com/_GwWyq5eGw9M/S9BHPHxW55I/AAAAAAAAB6Q/iGCWl0egGzg/s320/Birmingham+post+Lite+front.JPG'
|
||||||
oldest_article = 1
|
oldest_article = 2
|
||||||
max_articles_per_feed = 20
|
max_articles_per_feed = 12
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
auto_cleanup = True
|
#auto_cleanup = True
|
||||||
language = 'en_GB'
|
language = 'en_GB'
|
||||||
|
|
||||||
|
|
||||||
@ -17,9 +17,12 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe):
|
|||||||
|
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
#dict(name='h1',attrs={'id' : 'article-headline'}),
|
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(attrs={'class':['article-meta-author','article-meta-date','article main','art-o art-align-center otm-1 ']}),
|
||||||
#dict(name='p')
|
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'})
|
#dict(attrs={'id' : 'three-col'})
|
||||||
]
|
]
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
@ -28,7 +31,7 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
feeds = [
|
feeds = [
|
||||||
#(u'News',u'http://www.birminghampost.net/news/rss.xml'),
|
#(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'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'Sports',u'http://www.birminghampost.net/midlands-birmingham-sport/rss.xml'),
|
||||||
(u'Bloggs & Comments',u'http://www.birminghampost.net/comment/rss.xml')
|
(u'Bloggs & Comments',u'http://www.birminghampost.net/comment/rss.xml')
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
__license__ = 'GPL v3'
|
__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
|
www.nzz.ch
|
||||||
@ -10,7 +10,7 @@ from calibre.web.feeds.recipes import BasicNewsRecipe
|
|||||||
|
|
||||||
class Nzz(BasicNewsRecipe):
|
class Nzz(BasicNewsRecipe):
|
||||||
title = 'NZZ Online'
|
title = 'NZZ Online'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic, Bernd Leinfelder'
|
||||||
description = 'Laufend aktualisierte Nachrichten, Analysen und Hintergruende zu Politik, Wirtschaft, Kultur und Sport'
|
description = 'Laufend aktualisierte Nachrichten, Analysen und Hintergruende zu Politik, Wirtschaft, Kultur und Sport'
|
||||||
publisher = 'NZZ AG'
|
publisher = 'NZZ AG'
|
||||||
category = 'news, politics, nachrichten, Switzerland'
|
category = 'news, politics, nachrichten, Switzerland'
|
||||||
@ -41,31 +41,31 @@ class Nzz(BasicNewsRecipe):
|
|||||||
,'publisher' : publisher
|
,'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_attributes=['width','height','lang']
|
||||||
|
remove_tags_before = dict(id='main')
|
||||||
|
remove_tags_after = dict(id='articleBodyText')
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name=['object','link','base','meta','iframe'])
|
dict(name=['object','link','base','meta','iframe'])
|
||||||
,dict(attrs={'id':'content_rectangle_1'})
|
,dict(id='social-media-floater')
|
||||||
,dict(attrs={'class':['weiterfuehrendeLinks','fussnote','video']})
|
,dict(name='div',attrs={'class':['box']})
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'International' , u'http://www.nzz.ch/nachrichten/international?rss=true')
|
(u'International' , u'http://www.nzz.ch/aktuell/international.rss')
|
||||||
,(u'Schweiz' , u'http://www.nzz.ch/nachrichten/schweiz?rss=true')
|
,(u'Schweiz' , u'http://www.nzz.ch/aktuell/schweiz.rss')
|
||||||
,(u'Wirtschaft' , u'http://www.nzz.ch/nachrichten/wirtschaft/aktuell?rss=true')
|
,(u'Wirtschaft' , u'http://www.nzz.ch/aktuell/wirtschaft/uebersicht.rss')
|
||||||
,(u'Finanzmaerkte' , u'http://www.nzz.ch/finanzen/nachrichten?rss=true')
|
,(u'Finanzmaerkte' , u'http://www.nzz.ch/finanzen/uebersicht/finanznachrichten.rss')
|
||||||
,(u'Zuerich' , u'http://www.nzz.ch/nachrichten/zuerich?rss=true')
|
,(u'Zuerich' , u'http://www.nzz.ch/aktuell/zuerich/uebersicht.rss')
|
||||||
,(u'Sport' , u'http://www.nzz.ch/nachrichten/sport?rss=true')
|
,(u'Sport' , u'http://www.nzz.ch/aktuell/sport/uebersicht.rss')
|
||||||
,(u'Panorama' , u'http://www.nzz.ch/nachrichten/panorama?rss=true')
|
,(u'Panorama' , u'http://www.nzz.ch/aktuell/panorama.rss')
|
||||||
,(u'Kultur' , u'http://www.nzz.ch/nachrichten/kultur/aktuell?rss=true')
|
,(u'Kultur' , u'http://www.nzz.ch/aktuell/feuilleton/uebersicht.rss')
|
||||||
,(u'Wissenschaft' , u'http://www.nzz.ch/nachrichten/wissenschaft?rss=true')
|
,(u'Wissenschaft' , u'http://www.nzz.ch/wissen/uebersicht.rss')
|
||||||
,(u'Medien' , u'http://www.nzz.ch/nachrichten/medien?rss=true')
|
,(u'Reisen' , u'http://www.nzz.ch/lebensart/reisen-freizeit.rss')
|
||||||
,(u'Reisen' , u'http://www.nzz.ch/magazin/reisen?rss=true')
|
,(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)
|
|
||||||
|
@ -442,12 +442,6 @@ metadata_edit_custom_column_order = []
|
|||||||
# calibre.
|
# calibre.
|
||||||
public_smtp_relay_delay = 301
|
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
|
#: The maximum width and height for covers saved in the calibre library
|
||||||
# All covers in the calibre library will be resized, preserving aspect ratio,
|
# 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
|
# to fit within this size. This is to prevent slowdowns caused by extremely
|
||||||
|
@ -238,10 +238,11 @@ class LayoutMixin(object): # {{{
|
|||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
self.status_bar = StatusBar(self)
|
self.status_bar = StatusBar(self)
|
||||||
|
stylename = unicode(self.style().objectName())
|
||||||
for x in button_order:
|
for x in button_order:
|
||||||
button = getattr(self, x+'_splitter').button
|
button = getattr(self, x+'_splitter').button
|
||||||
button.setIconSize(QSize(24, 24))
|
button.setIconSize(QSize(24, 24))
|
||||||
if isosx:
|
if isosx and stylename != u'Calibre':
|
||||||
button.setStyleSheet('''
|
button.setStyleSheet('''
|
||||||
QToolButton { background: none; border:none; padding: 0px; }
|
QToolButton { background: none; border:none; padding: 0px; }
|
||||||
QToolButton:checked { background: rgba(0, 0, 0, 25%); }
|
QToolButton:checked { background: rgba(0, 0, 0, 25%); }
|
||||||
|
@ -183,10 +183,17 @@ Author matching is exact.</string>
|
|||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<string>Ignore files with the following extensions when automatically adding </string>
|
<item>
|
||||||
</property>
|
<widget class="QLabel" name="label_3">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_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>
|
<item>
|
||||||
<widget class="QListWidget" name="opt_blocked_auto_formats">
|
<widget class="QListWidget" name="opt_blocked_auto_formats">
|
||||||
<property name="alternatingRowColors">
|
<property name="alternatingRowColors">
|
||||||
|
@ -210,7 +210,7 @@ to be shown as user categories</string>
|
|||||||
<item row="0" column="0" colspan="4">
|
<item row="0" column="0" colspan="4">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><p>When you search for similar books by author, series, etc,
|
<string><p>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.
|
calibre constructs a search using the column lookup names defined below.
|
||||||
By changing the lookup name to a grouped search term you can
|
By changing the lookup name to a grouped search term you can
|
||||||
search multiple columns.</p></string>
|
search multiple columns.</p></string>
|
||||||
|
@ -25,13 +25,19 @@ class TagDelegate(QStyledItemDelegate): # {{{
|
|||||||
def paint(self, painter, option, index):
|
def paint(self, painter, option, index):
|
||||||
item = index.data(Qt.UserRole).toPyObject()
|
item = index.data(Qt.UserRole).toPyObject()
|
||||||
QStyledItemDelegate.paint(self, painter, option, index)
|
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:
|
if item.type != TagTreeItem.TAG:
|
||||||
return
|
return
|
||||||
if (item.tag.state == 0 and config['show_avg_rating'] and
|
if (item.tag.state == 0 and config['show_avg_rating'] and
|
||||||
item.tag.avg_rating is not None):
|
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,
|
r = style.subElementRect(style.SE_ItemViewItemDecoration,
|
||||||
option, widget)
|
option, widget)
|
||||||
icon = option.icon
|
icon = option.icon
|
||||||
@ -48,6 +54,7 @@ class TagDelegate(QStyledItemDelegate): # {{{
|
|||||||
icon.On)
|
icon.On)
|
||||||
painter.restore()
|
painter.restore()
|
||||||
|
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
class TagsView(QTreeView): # {{{
|
class TagsView(QTreeView): # {{{
|
||||||
|
@ -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.gui2.filename_pattern_ui import Ui_Form
|
||||||
from calibre import fit_image
|
from calibre import fit_image
|
||||||
from calibre.ebooks import BOOK_EXTENSIONS
|
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.progress_indicator import ProgressIndicator as _ProgressIndicator
|
||||||
from calibre.gui2.dnd import (dnd_has_image, dnd_get_image, dnd_get_files,
|
from calibre.gui2.dnd import (dnd_has_image, dnd_get_image, dnd_get_files,
|
||||||
IMAGE_EXTENSIONS, dnd_has_extension, DownloadDialog)
|
IMAGE_EXTENSIONS, dnd_has_extension, DownloadDialog)
|
||||||
@ -1000,13 +1000,6 @@ class SplitterHandle(QSplitterHandle):
|
|||||||
if oh != self.highlight:
|
if oh != self.highlight:
|
||||||
self.update()
|
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):
|
def mouseDoubleClickEvent(self, ev):
|
||||||
self.double_clicked.emit(self)
|
self.double_clicked.emit(self)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user