aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfeedgetter.py6
-rwxr-xr-xpyAggr3g470r.py14
-rwxr-xr-xutils.py6
3 files changed, 15 insertions, 11 deletions
diff --git a/feedgetter.py b/feedgetter.py
index 36495b43..5239dd2a 100755
--- a/feedgetter.py
+++ b/feedgetter.py
@@ -4,7 +4,7 @@
from __future__ import with_statement
__author__ = "Cedric Bonhomme"
-__version__ = "$Revision: 0.7 $"
+__version__ = "$Revision: 0.8 $"
__date__ = "$Date: 2010/03/01 $"
__copyright__ = "Copyright (c) 2010 Cedric Bonhomme"
__license__ = "GPLv3"
@@ -128,6 +128,10 @@ class FeedGetter(object):
# send the article
utils.send_mail(utils.mail_from, utils.mail_to, \
a_feed.feed.title.encode('utf-8'), description)
+ threading.Thread(None, utils.send_mail, \
+ None, (utils.mail_from, utils.mail_to, \
+ a_feed.feed.title.encode('utf-8'), description) \
+ )
except sqlite3.IntegrityError:
# article already in the base
pass
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index c7b2e94f..a9d6af8f 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -2,7 +2,7 @@
#-*- coding: utf-8 -*-
__author__ = "Cedric Bonhomme"
-__version__ = "$Revision: 0.9 $"
+__version__ = "$Revision: 1.0 $"
__date__ = "$Date: 2010/03/01 $"
__copyright__ = "Copyright (c) 2010 Cedric Bonhomme"
__license__ = "GPLv3"
@@ -114,15 +114,15 @@ class Root:
html += "<br />\n"
html += """<a href="/all_articles/%s">All articles</a>""" % (rss_feed_id,)
- if self.feeds[rss_feed_id][6] == "0":
- html += """ <a href="/tuned/start:%s">Stay tuned</a>""" % (rss_feed_id,)
- else:
- html += """ <a href="/tuned/stop:%s">Stop staying tuned</a>""" % (rss_feed_id,)
html += """ <a href="/mark_as_read/Feed_FromMainPage:%s">Mark all as read</a>""" % (rss_feed_id,)
if self.feeds[rss_feed_id][1] != 0:
html += """ <a href="/unread/%s" title="Unread article(s)"
>Unread article(s) (%s)</a>""" % (rss_feed_id, \
self.feeds[rss_feed_id][1])
+ if self.feeds[rss_feed_id][6] == "0":
+ html += """<br />\n<a href="/mail_notification/start:%s">Stay tuned</a>""" % (rss_feed_id,)
+ else:
+ html += """<br />\n<a href="/mail_notification(/stop:%s">Stop staying tuned</a>""" % (rss_feed_id,)
html += """<h4><a href="/#top">Top</a></h4>"""
html += "<hr />\n"
html += htmlfooter
@@ -553,7 +553,7 @@ class Root:
mark_as_read.exposed = True
- def tuned(self, param):
+ def mail_notification(self, param):
"""
Enable or disable to notifications of news for a feed.
"""
@@ -579,7 +579,7 @@ class Root:
c.close()
return self.index()
- tuned.exposed = True
+ mail_notification.exposed = True
def update(self, path=None, event = None):
diff --git a/utils.py b/utils.py
index 25031317..9fafe634 100755
--- a/utils.py
+++ b/utils.py
@@ -2,7 +2,7 @@
#-*- coding: utf-8 -*-
__author__ = "Cedric Bonhomme"
-__version__ = "$Revision: 0.3 $"
+__version__ = "$Revision: 0.4 $"
__date__ = "$Date: 2010/03/10 $"
__copyright__ = "Copyright (c) 2010 Cedric Bonhomme"
__license__ = "GPLv3"
@@ -176,7 +176,7 @@ def create_base():
Create the base if not exists.
"""
sqlite3.register_adapter(str, lambda s : s.decode('utf-8'))
- conn = sqlite3.connect("./var/feed.db", isolation_level = None)
+ conn = sqlite3.connect(sqlite_base, isolation_level = None)
c = conn.cursor()
c.execute('''create table if not exists feeds
(feed_title text, feed_site_link text, \
@@ -197,7 +197,7 @@ def load_feed():
list_of_feeds = []
list_of_articles = []
try:
- conn = sqlite3.connect("./var/feed.db", isolation_level = None)
+ conn = sqlite3.connect(sqlite_base, isolation_level = None)
c = conn.cursor()
list_of_feeds = c.execute("SELECT * FROM feeds").fetchall()
except:
bgstack15