From 0cb7a49d112d5194301497f0f78e61b42975bd3b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 17 Apr 2009 11:37:52 -0700 Subject: [PATCH] IGN:Updated Der standard and fix series box being too long initially on OS X --- src/calibre/gui2/dialogs/metadata_single.py | 8 +--- src/calibre/gui2/images/news/der_standard.png | Bin 0 -> 509 bytes .../web/feeds/recipes/recipe_der_standard.py | 44 ++++++++++++++---- 3 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 src/calibre/gui2/images/news/der_standard.png 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 0000000000000000000000000000000000000000..4d750fe5a8583839440916aae93cdb7bb2222f1e GIT binary patch literal 509 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCwj^(N7l!{JxM1({$v_d#0*}aI zAngIhZYQ(tK!Rljj_E)ete@fByPj|c21Yec7srr{dv9l4Zm$Q`4`|5=^vZrxz z8eZ>ND&RhK+v$Bp6<_+@J*DRcDYB|rZ9L|o>9|dKiu2-Nt&}5M{Px72__J|->a%in zec>6$k{K?>Jl!o|q@`K5WZRPn^?qT2hqea-)aN>{>`vzsirXJ!U>eC00bvTFR#$>6;u(RStv{wqZd@sV~& zt=pP(&A$^D8Lavo@}h_-`k&l&p}2+5ykq7XM$MIR_EqTddnkH}VfRTeDy)@S+IJz5 zDaN#J5?AEmi^obC@*b-{6s=-NzvQ02-DlP|VDPDyxJHyD7o{ear0S*s2?iqr14~^4 z6J0~|5CcmqQ$s6LQ(XgdD+7b?)=w>A8glbfGSe#2G?;}LT3DHwS(#WsG@J;T-vQLX N;OXk;vd$@?2>=Kjy)^&; literal 0 HcmV?d00001 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