From 2bab2fe99558e6414d032857cb9396431f84a9d2 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Fri, 19 Nov 2010 12:38:01 +0100 Subject: Added CSS ToolTips descitpion for unread page (/unread/). --- pyAggr3g470r.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 33b228ba..e60fef8f 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -619,10 +619,19 @@ class Root: self.feeds[rss_feed_id][4].encode('utf-8'), \ self.feeds[rss_feed_id][2].encode('utf-8')) - html += article[1].encode('utf-8') + \ - """ - %s
\n""" % \ + # descrition for the CSS ToolTips + article_content = utils.clear_string(article[4].encode('utf-8')) + if article_content: + description = " ".join(article_content[:500].split(' ')[:-1]) + else: + description = "No description." + + # a description line per article (date, title of the article and + # CSS description tooltips on mouse over) + html += article[1].encode('utf-8') + " - " + \ + """%s%s
\n""" % \ (rss_feed_id, article[0].encode('utf-8'), \ - article[2].encode('utf-8')) + article[2].encode('utf-8')[:150], description) if nb_unread == self.feeds[rss_feed_id][1]: html += """
\nMark all articles from this feed as read\n""" % \ -- cgit