From: W. Trevor King Date: Thu, 18 Oct 2012 17:31:07 +0000 (-0400) Subject: rss2email.py: don't create config-only feeds if they were in the datafile. X-Git-Tag: v3.0~72^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e13b5252f1fcdaefc4881059965553c16bd675d5;p=rss2email.git rss2email.py: don't create config-only feeds if they were in the datafile. --- 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]))