aboutsummaryrefslogtreecommitdiff
path: root/pyAggr3g470r.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-12-19 18:25:30 +0100
committercedricbonhomme <devnull@localhost>2010-12-19 18:25:30 +0100
commit6ce88f1b45ac236469b34c55f5ee2cb08596ee2a (patch)
treed72d2c8155eca688279b4b8e84be9048a2d54667 /pyAggr3g470r.py
parentCode improvements #2. (diff)
downloadnewspipe-6ce88f1b45ac236469b34c55f5ee2cb08596ee2a.tar.gz
newspipe-6ce88f1b45ac236469b34c55f5ee2cb08596ee2a.tar.bz2
newspipe-6ce88f1b45ac236469b34c55f5ee2cb08596ee2a.zip
Code improvements #2.
Diffstat (limited to 'pyAggr3g470r.py')
-rwxr-xr-xpyAggr3g470r.py42
1 files changed, 14 insertions, 28 deletions
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 = "<b>"
- not_read_end = "</b>"
+ not_read_begin, not_read_end = "<b>", "</b>"
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 = "<b>"
- not_read_end = "</b>"
+ not_read_begin, not_read_end = "<b>", "</b>"
else:
- not_read_begin = ""
- not_read_end = ""
- html += """<div><a href="/#%s">%s</a> (<a href="/unread/%s"
- title="Unread article(s)">%s%s%s</a> / %s)</div>""" % \
+ not_read_begin, not_read_end = "", ""
+ html += """<div><a href="/#%s">%s</a> (<a href="/unread/%s" title="Unread article(s)">%s%s%s</a> / %s)</div>""" % \
(feed.feed_id, feed.feed_title, feed.feed_id, not_read_begin, \
feed.nb_unread_articles, not_read_end, feed.nb_articles)
return html + "</div>"
@@ -262,8 +257,7 @@ class Root:
html += "<h1>Delete Feeds</h1>\n"
html += """<form method=get action="/remove_feed/"><select name="feed_id">\n"""
for feed in self.feeds.values():
- html += """\t<option value="%s">%s</option>\n""" % \
- (feed.feed_id, feed.feed_title)
+ html += """\t<option value="%s">%s</option>\n""" % (feed.feed_id, feed.feed_title)
html += """</select><input type="submit" value="OK"></form>\n"""
html += """<p>Active e-mail notifications: <a href="/notifications/">%s</a></p>\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 = "<b>"
- not_read_end = "</b>"
+ not_read_begin, not_read_end = "<b>", "</b>"
else:
- not_read_begin = ""
- not_read_end = ""
+ not_read_begin, not_read_end = "", ""
html += article.article_date + " - " + not_read_begin + \
"""<a href="/article/%s:%s" rel="noreferrer" target="_blank">%s</a>""" % \
@@ -358,11 +350,9 @@ class Root:
if article.article_readed == "0":
# not readed articles are in bold
- not_read_begin = "<b>"
- not_read_end = "</b>"
+ not_read_begin, not_read_end = "<b>", "</b>"
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 = "<b>"
- not_read_end = "</b>"
+ not_read_begin, not_read_end = "<b>", "</b>"
else:
- not_read_begin = ""
- not_read_end = ""
+ not_read_begin, not_read_end = "", ""
if article.like == "1":
like = """ <img src="/css/img/heart.png" title="I like this article!" />"""
@@ -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 = "<b>"
- not_read_end = "</b>"
+ not_read_begin, not_read_end = "<b>", "</b>"
else:
- not_read_begin = ""
- not_read_end = ""
+ not_read_begin, not_read_end = "", ""
if article.like == "1":
like = """ <img src="/css/img/heart.png" title="I like this article!" />"""
bgstack15