aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-01-20 23:27:42 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-01-20 23:27:42 +0100
commit3be2806302d5dba0d0b8dbf887905c86b4976ea2 (patch)
treec84aaee8b187de58bef09c4d9fce1e196988bc6c
parentUpdated comment. (diff)
downloadnewspipe-3be2806302d5dba0d0b8dbf887905c86b4976ea2.tar.gz
newspipe-3be2806302d5dba0d0b8dbf887905c86b4976ea2.tar.bz2
newspipe-3be2806302d5dba0d0b8dbf887905c86b4976ea2.zip
Re-enabled mail notification.
-rwxr-xr-xsource/feedgetter.py13
1 files 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__":
bgstack15