From e13b5252f1fcdaefc4881059965553c16bd675d5 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 18 Oct 2012 13:31:07 -0400 Subject: [PATCH] rss2email.py: don't create config-only feeds if they were in the datafile. --- rss2email.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rss2email.py b/rss2email.py index 86b16e4..4fa7edb 100755 --- a/rss2email.py +++ b/rss2email.py @@ -1364,13 +1364,16 @@ class Feeds (list): for feed in self: feed.load_from_config(self.config) + feed_names = set(feed.name for feed in self) for section in self.config.sections(): if section.startswith('feed.'): name = section[len('feed.'):] - LOG.debug( - ('feed {} not found feed file, initializing from config' - ).format(name)) - self.append(Feed(name=name, config=self.config)) + if name not in feed_names: + LOG.debug( + ('feed {} not found in feed file, ' + 'initializing from config').format(name)) + self.append(Feed(name=name, config=self.config)) + feed_names.add(name) def save(self): LOG.debug('save feed configuration to {}'.format(self.configfiles[-1])) -- 2.26.2