From 6ce88f1b45ac236469b34c55f5ee2cb08596ee2a Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Sun, 19 Dec 2010 18:25:30 +0100 Subject: Code improvements #2. --- pyAggr3g470r.py | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) (limited to 'pyAggr3g470r.py') diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 4827e4f2..69f3b5ae 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -163,11 +163,9 @@ class Root: if article.article_readed == "0": # not readed articles are in bold - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" else: - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" # display a heart for faved articles if article.like == "1": @@ -232,13 +230,10 @@ class Root: for feed in self.feeds.values(): if feed.nb_unread_articles != 0: # not readed articles are in bold - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" else: - not_read_begin = "" - not_read_end = "" - html += """
%s (%s%s%s / %s)
""" % \ + not_read_begin, not_read_end = "", "" + html += """
%s (%s%s%s / %s)
""" % \ (feed.feed_id, feed.feed_title, feed.feed_id, not_read_begin, \ feed.nb_unread_articles, not_read_end, feed.nb_articles) return html + "" @@ -262,8 +257,7 @@ class Root: html += "

Delete Feeds

\n" html += """
\n""" html += """

Active e-mail notifications: %s

\n""" % \ @@ -333,11 +327,9 @@ class Root: if wordre.findall(article_content) != []: if article.article_readed == "0": # not readed articles are in bold - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" else: - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" html += article.article_date + " - " + not_read_begin + \ """%s""" % \ @@ -358,11 +350,9 @@ class Root: if article.article_readed == "0": # not readed articles are in bold - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" else: - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" # display a heart for faved articles if article.like == "1": @@ -553,11 +543,9 @@ class Root: if article.article_readed == "0": # not readed articles are in bold - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" else: - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" if article.like == "1": like = """ """ @@ -699,11 +687,9 @@ class Root: if article.article_date.split(' ')[0].split('-')[1] == the_month: if article.article_readed == "0": # not readed articles are in bold - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" else: - not_read_begin = "" - not_read_end = "" + not_read_begin, not_read_end = "", "" if article.like == "1": like = """ """ -- cgit