From 3be2806302d5dba0d0b8dbf887905c86b4976ea2 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 20 Jan 2013 23:27:42 +0100 Subject: Re-enabled mail notification. --- source/feedgetter.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/feedgetter.py b/source/feedgetter.py index fba7e6a7..2dc892ac 100755 --- a/source/feedgetter.py +++ b/source/feedgetter.py @@ -108,7 +108,8 @@ class FeedGetter(object): sha1_hash.update(feed_link.encode('utf-8')) feed_id = sha1_hash.hexdigest() - if None == self.articles.get_feed(feed_id): + feed = self.articles.get_feed(feed_id) + if None == feed: collection_dic = {"feed_id": feed_id, \ "type": 0, \ "feed_image": feed_image, \ @@ -156,11 +157,11 @@ class FeedGetter(object): self.articles.add_articles(articles, feed_id) - # send new articles by e-mail if desired. - #threading.Thread(None, utils.send_mail, None, (conf.mail_from, conf.mail_to, \ - #a_feed.feed.title, \ - #article_title, description) \ - #).start() + if feed["mail"]: + # send new articles by e-mail if desired. + threading.Thread(None, utils.send_mail, None, (conf.mail_from, conf.mail_to, \ + a_feed.feed.title, \ + article_title, description)).start() if __name__ == "__main__": -- cgit