From 38d3be5cabdeed9a845cf5f8a925dc8a13db4b20 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 29 Aug 2010 12:39:20 -0600 Subject: [PATCH] News download: Don't add downloaded from link when the download is from a temp file. Also fix Slate --- resources/recipes/slate.recipe | 1 - src/calibre/web/feeds/templates.py | 15 ++++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/recipes/slate.recipe b/resources/recipes/slate.recipe index 07ed89d0f4..c03255d2df 100644 --- a/resources/recipes/slate.recipe +++ b/resources/recipes/slate.recipe @@ -102,7 +102,6 @@ class PeriodicalNameHere(BasicNewsRecipe): todays_section = soup.find(True, attrs={'class':'todaydateline'}) self.section_dates.append(self.tag_to_string(todays_section,use_alt=False)) - self.section_dates.append(self.tag_to_string(todays_section,use_alt=False)) older_section_dates = soup.findAll(True, attrs={'class':'maindateline'}) for older_section in older_section_dates : diff --git a/src/calibre/web/feeds/templates.py b/src/calibre/web/feeds/templates.py index e23b8dda1b..6e8168be31 100644 --- a/src/calibre/web/feeds/templates.py +++ b/src/calibre/web/feeds/templates.py @@ -193,13 +193,14 @@ class NavBarTemplate(Template): navbar = DIV(CLASS('calibre_navbar', 'calibre_rescale_70', style='text-align:'+align)) if bottom: - navbar.append(HR()) - text = 'This article was downloaded by ' - p = PT(text, STRONG(__appname__), A(url, href=url), - style='text-align:left; max-width: 100%; overflow: hidden;') - p[0].tail = ' from ' - navbar.append(p) - navbar.append(BR()) + if not url.startswith('file://'): + navbar.append(HR()) + text = 'This article was downloaded by ' + p = PT(text, STRONG(__appname__), A(url, href=url), + style='text-align:left; max-width: 100%; overflow: hidden;') + p[0].tail = ' from ' + navbar.append(p) + navbar.append(BR()) navbar.append(BR()) else: next = 'feed_%d'%(feed+1) if art == number_of_articles_in_feed - 1 \