From d5f369ce8b1a772b9cd439920580ca362348afd8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 14 Dec 2009 09:46:24 -0700 Subject: [PATCH] Improved recipe for HRT: Vesti --- resources/recipes/hrt.recipe | 12 +++++++++++- src/calibre/customize/conversion.py | 2 +- src/calibre/web/feeds/input.py | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/resources/recipes/hrt.recipe b/resources/recipes/hrt.recipe index 71cead5d17..9d474471e7 100644 --- a/resources/recipes/hrt.recipe +++ b/resources/recipes/hrt.recipe @@ -11,6 +11,8 @@ import re from calibre.web.feeds.news import BasicNewsRecipe from calibre.ebooks.BeautifulSoup import Tag +adfad + class HRT(BasicNewsRecipe): title = 'HRT: Vesti' __author__ = 'Darko Miletic' @@ -23,7 +25,14 @@ class HRT(BasicNewsRecipe): language = 'hr' lang = 'hr-HR' - extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} body{font-family: serif1, serif} .article_description{font-family: serif1, serif}' + extra_css = '''@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} + body{font-family: serif1, serif} .article_description{font-family: serif1, serif} + .news-single-timedata{color:#20558A; font-size:x-small;} + .nsTitle{color:#20558A; font-size:large; font-weight:bold;} + a{color:#20558A;} + .external-link-new-window{color:#20558A;} + + ''' conversion_options = { 'comment' : description @@ -36,6 +45,7 @@ class HRT(BasicNewsRecipe): preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + keep_only_tags = [dict(name='div', attrs={'class':'bigVijest'})] remove_tags = [dict(name=['object','link','embed'])] diff --git a/src/calibre/customize/conversion.py b/src/calibre/customize/conversion.py index edc6ba2639..a4c8a43e59 100644 --- a/src/calibre/customize/conversion.py +++ b/src/calibre/customize/conversion.py @@ -196,7 +196,7 @@ class InputFormatPlugin(Plugin): def __call__(self, stream, options, file_ext, log, accelerators, output_dir): - log('InputFormatPlugin: %s running'%self.name, end=' ') + log('InputFormatPlugin: %s running'%self.name) if hasattr(stream, 'name'): log('on', stream.name) diff --git a/src/calibre/web/feeds/input.py b/src/calibre/web/feeds/input.py index ea65511506..de561b39b2 100644 --- a/src/calibre/web/feeds/input.py +++ b/src/calibre/web/feeds/input.py @@ -60,7 +60,7 @@ class RecipeInput(InputFormatPlugin): log.warn( 'Downloaded recipe needs calibre version at least: %s' % \ recipe.requires_version) - builtin = True + builtin = True except: log.exception('Failed to compile downloaded recipe. Falling ' 'back to builtin one')