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
b6c8d49043
@ -1,11 +1,11 @@
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
import re
|
||||
|
||||
class AdvancedUserRecipe(BasicNewsRecipe):
|
||||
|
||||
title = 'heise online'
|
||||
title = 'Heise-online'
|
||||
description = 'News vom Heise-Verlag'
|
||||
__author__ = 'schuster'
|
||||
masthead_url = 'http://www.heise.de/icons/ho/heise_online_logo.gif'
|
||||
publisher = 'Heise Zeitschriften Verlag GmbH & Co. KG'
|
||||
use_embedded_content = False
|
||||
language = 'de'
|
||||
oldest_article = 2
|
||||
@ -14,11 +14,10 @@ class AdvancedUserRecipe(BasicNewsRecipe):
|
||||
remove_empty_feeds = True
|
||||
timeout = 5
|
||||
no_stylesheets = True
|
||||
encoding = 'utf-8'
|
||||
|
||||
|
||||
remove_tags_after = dict(name ='p', attrs={'class':'editor'})
|
||||
remove_tags = [{'class':'navi_top_container'},
|
||||
remove_tags = [dict(id='navi_top_container'),
|
||||
dict(id='navi_bottom'),
|
||||
dict(id='mitte_rechts'),
|
||||
dict(id='navigation'),
|
||||
@ -29,27 +28,31 @@ class AdvancedUserRecipe(BasicNewsRecipe):
|
||||
dict(id='seiten_navi'),
|
||||
dict(id='adbottom'),
|
||||
dict(id='sitemap'),
|
||||
dict(name='a', href=re.compile(r'^/([a-zA-Z]+/)?')),
|
||||
]
|
||||
dict(name='div', attrs={'id':'sitemap'}),
|
||||
dict(name='ul', attrs={'class':'erste_zeile'}),
|
||||
dict(name='ul', attrs={'class':'zweite_zeile'}),
|
||||
dict(name='div', attrs={'class':'navi_top_container'})]
|
||||
|
||||
feeds = [
|
||||
('Newsticker', 'http://www.heise.de/newsticker/heise.rdf'),
|
||||
('iX', 'http://www.heise.de/ix/news/news.rdf'),
|
||||
('Technology Review', 'http://www.heise.de/tr/news-atom.xml'),
|
||||
('mobil', 'http://www.heise.de/mobil/newsticker/heise-atom.xml'),
|
||||
('Security', 'http://www.heise.de/security/news/news-atom.xml'),
|
||||
('Netze', 'http://www.heise.de/netze/rss/netze-atom.xml'),
|
||||
('Open Source', 'http://www.heise.de/open/news/news-atom.xml'),
|
||||
('Resale ', 'http://www.heise.de/resale/rss/resale.rdf'),
|
||||
('Auto', 'http://www.heise.de/autos/rss/news.rdf'),
|
||||
('Foto ', 'http://www.heise.de/foto/rss/news-atom.xml'),
|
||||
('Autos', 'http://www.heise.de/autos/rss/news.rdf'),
|
||||
('Mac & i', 'http://www.heise.de/mac-and-i/news.rdf'),
|
||||
('Mac&i', 'http://www.heise.de/mac-and-i/news.rdf'),
|
||||
('Mobile ', 'http://www.heise.de/mobil/newsticker/heise-atom.xml'),
|
||||
('Netz ', 'http://www.heise.de/netze/rss/netze-atom.xml'),
|
||||
('Open ', 'http://www.heise.de/open/news/news-atom.xml'),
|
||||
('Resale ', 'http://www.heise.de/resale/rss/resale.rdf'),
|
||||
('Security ', 'http://www.heise.de/security/news/news-atom.xml'),
|
||||
('C`t', 'http://www.heise.de/ct/rss/artikel-atom.xml'),
|
||||
('iX', 'http://www.heise.de/ix/news/news.rdf'),
|
||||
('Mach-flott', 'http://www.heise.de/mach-flott/rss/mach-flott-atom.xml'),
|
||||
('Blog: Babel-Bulletin', 'http://www.heise.de/developer/rss/babel-bulletin/blog.rdf'),
|
||||
('Blog: Der Dotnet-Doktor', 'http://www.heise.de/developer/rss/dotnet-doktor/blog.rdf'),
|
||||
('Blog: Bernds Management-Welt', 'http://www.heise.de/developer/rss/bernds-management-welt/blog.rdf'),
|
||||
('Blog: The World of IT', 'http://www.heise.de/developer/rss/world-of-it/blog.rdf'),
|
||||
('Blog: Kais bewegtes Web', 'http://www.heise.de/developer/rss/kais-bewegtes-web/blog.rdf')
|
||||
]
|
||||
('Blog: IT conversation', 'http://www.heise.de/developer/rss/world-of-it/blog.rdf'),
|
||||
('Blog: Kais bewegtes Web', 'http://www.heise.de/developer/rss/kais-bewegtes-web/blog.rdf')]
|
||||
|
||||
def print_version(self, url):
|
||||
return url + '?view=print'
|
||||
|
||||
|
||||
|
@ -5,7 +5,6 @@ www.theweek.com
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
import re
|
||||
|
||||
class TheWeek(BasicNewsRecipe):
|
||||
title = 'The Week Magazine'
|
||||
@ -21,23 +20,7 @@ class TheWeek(BasicNewsRecipe):
|
||||
encoding = 'utf-8'
|
||||
use_embedded_content = False
|
||||
language = 'en'
|
||||
preprocess_regexps = [(re.compile(r'<h3><a href=.*</body>', re.DOTALL), lambda match: '</body>')]
|
||||
remove_tags_before = dict(name='h1')
|
||||
remove_tags_after = dict(name='div', attrs={'class':'articleSubscribe4free'})
|
||||
remove_tags = [
|
||||
dict(name='div', attrs={'class':['floatLeft','imageCaption','slideshowImageAttribution','postDate','utilities','cartoonInfo','left','middle','col300','articleSubscribe4free',' articleFlyout','articleFlyout floatRight','fourFreeBar']})
|
||||
,dict(name='div', attrs={'id':['cartoonThumbs','rightColumn','header','partners']})
|
||||
,dict(name='ul', attrs={'class':['slideshowNav','hotTopicsList topicList']})
|
||||
]
|
||||
remove_attributes = ['width','height', 'style', 'font', 'color']
|
||||
extra_css = '''
|
||||
h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;}
|
||||
h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;}
|
||||
h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;}
|
||||
p {font-family:Arial,Helvetica,sans-serif;}
|
||||
'''
|
||||
filter_regexps = [r'www\.palmcoastdata\.com']
|
||||
|
||||
auto_cleanup = True
|
||||
feeds = [
|
||||
(u'News-Opinion', u'http://theweek.com/section/index/news_opinion.rss'),
|
||||
(u'Business', u'http://theweek.com/section/index/business.rss'),
|
||||
|
@ -40,8 +40,7 @@
|
||||
In addition you can add code to show the values of custom columns here.
|
||||
The value is available as _column_name and the title as _column_name_label.
|
||||
For example, if you have a custom column with label #genre, you can add it to
|
||||
this template with:
|
||||
<div>{_genre_label}: {_genre}</div>
|
||||
this template with _genre_label and _genre. Note that the # is replaced by an underscore.
|
||||
-->
|
||||
|
||||
<div class="cbj_comments">{comments}</div>
|
||||
|
@ -388,13 +388,9 @@ class KINDLE_FIRE(KINDLE2):
|
||||
|
||||
EBOOK_DIR_MAIN = 'Documents'
|
||||
SUPPORTS_SUB_DIRS = False
|
||||
SCAN_FROM_ROOT = True
|
||||
SUPPORTS_SUB_DIRS_FOR_SCAN = True
|
||||
VENDOR_NAME = 'AMAZON'
|
||||
WINDOWS_MAIN_MEM = 'KINDLE'
|
||||
|
||||
def get_main_ebook_dir(self, for_upload=False):
|
||||
if for_upload:
|
||||
return self.EBOOK_DIR_MAIN
|
||||
return ''
|
||||
|
||||
|
||||
|
||||
|
@ -81,7 +81,7 @@ class NOOK(USBMS):
|
||||
return [x.replace('#', '_') for x in components]
|
||||
|
||||
class NOOK_COLOR(NOOK):
|
||||
description = _('Communicate with the Nook Color and TSR eBook readers.')
|
||||
description = _('Communicate with the Nook Color, TSR and Tablet eBook readers.')
|
||||
|
||||
PRODUCT_ID = [0x002, 0x003, 0x004]
|
||||
BCD = [0x216]
|
||||
|
@ -28,6 +28,8 @@ class DeviceConfig(object):
|
||||
EXTRA_CUSTOMIZATION_DEFAULT = None
|
||||
|
||||
SUPPORTS_SUB_DIRS = False
|
||||
SUPPORTS_SUB_DIRS_FOR_SCAN = False # This setting is used when scanning for
|
||||
# books when SUPPORTS_SUB_DIRS is False
|
||||
MUST_READ_METADATA = False
|
||||
SUPPORTS_USE_AUTHOR_SORT = False
|
||||
|
||||
|
@ -202,7 +202,7 @@ class USBMS(CLI, Device):
|
||||
debug_print('USBMS: scan from root', self.SCAN_FROM_ROOT, ebook_dir)
|
||||
if not os.path.exists(ebook_dir): continue
|
||||
# Get all books in the ebook_dir directory
|
||||
if self.SUPPORTS_SUB_DIRS:
|
||||
if self.SUPPORTS_SUB_DIRS or self.SUPPORTS_SUB_DIRS_FOR_SCAN:
|
||||
# build a list of files to check, so we can accurately report progress
|
||||
flist = []
|
||||
for path, dirs, files in os.walk(ebook_dir):
|
||||
|
Loading…
x
Reference in New Issue
Block a user