From 2c25153079ef2202432fa3047066c41eee16fce0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 28 Jul 2009 14:33:44 -0600 Subject: [PATCH] Fix Newsweek recipe and Implement #2975 (Validation for i/o filenames in ebook-convert) --- src/calibre/ebooks/conversion/plumber.py | 2 ++ src/calibre/web/feeds/recipes/recipe_newsweek.py | 1 + 2 files changed, 3 insertions(+) diff --git a/src/calibre/ebooks/conversion/plumber.py b/src/calibre/ebooks/conversion/plumber.py index cb7cd519f0..f8eba6dac2 100644 --- a/src/calibre/ebooks/conversion/plumber.py +++ b/src/calibre/ebooks/conversion/plumber.py @@ -53,6 +53,8 @@ class Plumber(object): ''' self.input = os.path.abspath(input) self.output = os.path.abspath(output) + if self.input == self.output: + raise ValueError('Input file is the same as the output file') self.log = log self.ui_reporter = report_progress diff --git a/src/calibre/web/feeds/recipes/recipe_newsweek.py b/src/calibre/web/feeds/recipes/recipe_newsweek.py index 0146c0541f..c7f043ef74 100644 --- a/src/calibre/web/feeds/recipes/recipe_newsweek.py +++ b/src/calibre/web/feeds/recipes/recipe_newsweek.py @@ -30,6 +30,7 @@ class Newsweek(BasicNewsRecipe): remove_tags = [ {'class':['fwArticle noHr','fwArticle','subinfo','hdlBulletItem','head-content','navbar','link', 'ad', 'sponsorLinksArticle', 'mm-content', 'inline-social-links-wrapper', 'email-article', + 'inlineComponentRight', 'comments-and-social-links-wrapper', 'EmailArticleBlock']}, {'id' : ['footer', 'ticker-data', 'topTenVertical', 'digg-top-five', 'mesothorax', 'nw-comments',