mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Recipe for Science Daily (thanks to Darko Miletic)
This commit is contained in:
parent
18203fe159
commit
aec0107b79
@ -36,11 +36,11 @@ class JobsDialog(QDialog, Ui_JobsDialog):
|
|||||||
self.model = model
|
self.model = model
|
||||||
self.setWindowModality(Qt.NonModal)
|
self.setWindowModality(Qt.NonModal)
|
||||||
self.setWindowTitle(__appname__ + _(' - Jobs'))
|
self.setWindowTitle(__appname__ + _(' - Jobs'))
|
||||||
QObject.connect(self.jobs_view.model(), SIGNAL('modelReset()'),
|
QObject.connect(self.jobs_view.model(), SIGNAL('modelReset()'),
|
||||||
self.jobs_view.resizeColumnsToContents)
|
self.jobs_view.resizeColumnsToContents)
|
||||||
QObject.connect(self.kill_button, SIGNAL('clicked()'),
|
QObject.connect(self.kill_button, SIGNAL('clicked()'),
|
||||||
self.kill_job)
|
self.kill_job)
|
||||||
QObject.connect(self, SIGNAL('kill_job(int, PyQt_PyObject)'),
|
QObject.connect(self, SIGNAL('kill_job(int, PyQt_PyObject)'),
|
||||||
self.jobs_view.model().kill_job)
|
self.jobs_view.model().kill_job)
|
||||||
self.pb_delegate = ProgressBarDelegate(self)
|
self.pb_delegate = ProgressBarDelegate(self)
|
||||||
self.jobs_view.setItemDelegateForColumn(2, self.pb_delegate)
|
self.jobs_view.setItemDelegateForColumn(2, self.pb_delegate)
|
||||||
@ -53,7 +53,7 @@ class JobsDialog(QDialog, Ui_JobsDialog):
|
|||||||
model = self.model
|
model = self.model
|
||||||
for row, job in enumerate(model.jobs):
|
for row, job in enumerate(model.jobs):
|
||||||
if job.is_running:
|
if job.is_running:
|
||||||
self.jobs_view.dataChanged(model.index(row, 3), model.index(row, 3))
|
self.jobs_view.dataChanged(model.index(row, 3), model.index(row, 3))
|
||||||
|
|
||||||
def kill_job(self):
|
def kill_job(self):
|
||||||
for index in self.jobs_view.selectedIndexes():
|
for index in self.jobs_view.selectedIndexes():
|
||||||
|
BIN
src/calibre/gui2/images/news/sciencedaily.png
Normal file
BIN
src/calibre/gui2/images/news/sciencedaily.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 763 B |
@ -18,7 +18,7 @@ recipe_modules = [
|
|||||||
'nytimes_sub', 'security_watch', 'cyberpresse', 'st_petersburg_times',
|
'nytimes_sub', 'security_watch', 'cyberpresse', 'st_petersburg_times',
|
||||||
'clarin', 'financial_times', 'heise', 'le_monde', 'harpers', 'science_aas',
|
'clarin', 'financial_times', 'heise', 'le_monde', 'harpers', 'science_aas',
|
||||||
'science_news', 'the_nation', 'lrb', 'harpers_full', 'liberation',
|
'science_news', 'the_nation', 'lrb', 'harpers_full', 'liberation',
|
||||||
'linux_magazine', 'telegraph_uk', 'utne',
|
'linux_magazine', 'telegraph_uk', 'utne', 'sciencedaily'
|
||||||
]
|
]
|
||||||
|
|
||||||
import re, imp, inspect, time, os
|
import re, imp, inspect, time, os
|
||||||
|
32
src/calibre/web/feeds/recipes/sciencedaily.py
Normal file
32
src/calibre/web/feeds/recipes/sciencedaily.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
sciencedaily.com
|
||||||
|
'''
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class ScienceDaily(BasicNewsRecipe):
|
||||||
|
title = u'ScienceDaily'
|
||||||
|
__author__ = u'Darko Miletic'
|
||||||
|
description = u"Breaking science news and articles on global warming, extrasolar planets, stem cells, bird flu, autism, nanotechnology, dinosaurs, evolution -- the latest discoveries in astronomy, anthropology, biology, chemistry, climate & environment, computers, engineering, health & medicine, math, physics, psychology, technology, and more -- from the world's leading universities and research organizations."
|
||||||
|
oldest_article = 7
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = False
|
||||||
|
|
||||||
|
cover_url = 'http://www.sciencedaily.com/images/logo.gif'
|
||||||
|
|
||||||
|
keep_only_tags = [
|
||||||
|
dict(name='h1', attrs={'class':'story'})
|
||||||
|
,dict(name='div', attrs={'id':'story'})
|
||||||
|
]
|
||||||
|
|
||||||
|
remove_tags_after = dict(name='div', attrs={'id':'citationbox'})
|
||||||
|
remove_tags = [
|
||||||
|
dict(name='div', attrs={'id':'seealso'})
|
||||||
|
,dict(name='div', attrs={'id':'citationbox'})
|
||||||
|
]
|
||||||
|
|
||||||
|
feeds = [(u"ScienceDaily", u'http://www.sciencedaily.com/newsfeed.xml')]
|
Loading…
x
Reference in New Issue
Block a user