diff --git a/src/calibre/gui2/dialogs/metadata_single.py b/src/calibre/gui2/dialogs/metadata_single.py index c48c7c3640..4a74c87097 100644 --- a/src/calibre/gui2/dialogs/metadata_single.py +++ b/src/calibre/gui2/dialogs/metadata_single.py @@ -319,6 +319,7 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog): self.cover_changed = True def initialize_series(self): + self.series.setSizeAdjustPolicy(self.series.AdjustToContentsOnFirstShow) all_series = self.db.all_series() all_series.sort(cmp=lambda x, y : cmp(x[1], y[1])) series_id = self.db.series_id(self.row) @@ -335,13 +336,6 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog): self.series.setCurrentIndex(idx) self.enable_series_index() - pl = self.series.parentWidget().layout() - for i in range(pl.count()): - l = pl.itemAt(i).layout() - if l: - l.invalidate() - l.activate() - def initialize_series_and_publisher(self): self.initialize_series() all_publishers = self.db.all_publishers() diff --git a/src/calibre/gui2/images/news/der_standard.png b/src/calibre/gui2/images/news/der_standard.png new file mode 100644 index 0000000000..4d750fe5a8 Binary files /dev/null and b/src/calibre/gui2/images/news/der_standard.png differ diff --git a/src/calibre/web/feeds/recipes/recipe_der_standard.py b/src/calibre/web/feeds/recipes/recipe_der_standard.py index eec4c4e74d..c053d74cfb 100644 --- a/src/calibre/web/feeds/recipes/recipe_der_standard.py +++ b/src/calibre/web/feeds/recipes/recipe_der_standard.py @@ -1,14 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +__license__ = 'GPL v3' +__copyright__ = '2009, Gerhard Aigner ' ''' http://www.derstandard.at - Austrian Newspaper ''' import re from calibre.web.feeds.news import BasicNewsRecipe class DerStandardRecipe(BasicNewsRecipe): - title = u'derStandard' - __author__ = 'Gerhard Aigner' - + title = u'derStandard' + __author__ = 'Gerhard Aigner' + description = u'Nachrichten aus Österreich' + publisher ='derStandard.at' + category = 'news, politics, nachrichten, Austria' + use_embedded_content = False + remove_empty_feeds = True + lang = 'de-AT' + no_stylesheets = True + encoding = 'utf-8' + language = _('German') + recursions = 0 oldest_article = 1 max_articles_per_feed = 100 + + html2lrf_options = [ + '--comment' , description + , '--category' , category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' + feeds = [(u'International', u'http://derstandard.at/?page=rss&ressort=internationalpolitik'), (u'Inland', u'http://derstandard.at/?page=rss&ressort=innenpolitik'), (u'Wirtschaft', u'http://derstandard.at/?page=rss&ressort=investor'), @@ -20,17 +43,13 @@ class DerStandardRecipe(BasicNewsRecipe): (u'Wissenschaft', u'http://derstandard.at/?page=rss&ressort=wissenschaft'), (u'Gesundheit', u'http://derstandard.at/?page=rss&ressort=gesundheit'), (u'Bildung', u'http://derstandard.at/?page=rss&ressort=subildung')] - - encoding = 'utf-8' - language = _('German') - recursions = 0 remove_tags = [dict(name='div'), dict(name='a'), dict(name='link'), dict(name='meta'), dict(name='form',attrs={'name':'sitesearch'}), dict(name='hr')] preprocess_regexps = [ - (re.compile(r'\[[\d*]\]', re.DOTALL|re.IGNORECASE), lambda match: ''), + (re.compile(r'\[[\d]*\]', re.DOTALL|re.IGNORECASE), lambda match: ''), (re.compile(r'bgcolor="#\w{3,6}"', re.DOTALL|re.IGNORECASE), lambda match: '') ] - + def print_version(self, url): return url.replace('?id=', 'txt/?id=') @@ -40,3 +59,10 @@ class DerStandardRecipe(BasicNewsRecipe): if (article.link.count('ressort') > 0 or article.title.lower().count('ansichtssache') > 0): return None return article.link + + def preprocess_html(self, soup): + soup.html['xml:lang'] = self.lang + soup.html['lang'] = self.lang + mtag = '' + soup.head.insert(0,mtag) + return soup \ No newline at end of file