From 350561802478daa9dbe9c55177fd9c8fc2930f7f Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Sun, 15 Apr 2012 18:51:32 +0200 Subject: Better use of datetime. --- pyAggr3g470r.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index ea708d18..1284ea3e 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -183,7 +183,7 @@ class Root: # a description line per article (date, title of the article and # CSS description tooltips on mouse over) - html += str(article["article_date"]) + " - " + \ + html += article["article_date"].ctime() + " - " + \ """%s%s%s%s""" % \ (feed["feed_id"], article["article_id"], not_read_begin, \ article_title, not_read_end, description) + like + "
\n" @@ -405,7 +405,7 @@ class Root: # a description line per article (date, title of the article and # CSS description tooltips on mouse over) - html += str(article["article_date"]) + " - " + \ + html += article["article_date"].ctime() + " - " + \ """%s%s%s%s""" % \ (feed["feed_id"], article["article_id"], not_read_begin, \ article["article_title"][:150], not_read_end, description) + like + "
\n" @@ -633,7 +633,7 @@ class Root: # a description line per article (date, title of the article and # CSS description tooltips on mouse over) - html += str(article["article_date"]) + " - " + \ + html += article["article_date"].ctime() + " - " + \ """%s%s%s%s""" % \ (feed["feed_id"], article["article_id"], not_read_begin, \ article_title, not_read_end, description) + like + "
\n" @@ -654,7 +654,7 @@ class Root: # a description line per article (date, title of the article and # CSS description tooltips on mouse over) - html += str(article["article_date"]) + " - " + \ + html += article["article_date"].ctime() + " - " + \ """%s%s
\n""" % \ (feed["feed_id"], article["article_id"], article["article_title"][:150], description) @@ -741,7 +741,7 @@ class Root: # a description line per article (date, title of the article and # CSS description tooltips on mouse over) - html += str(article["article_date"]) + " - " + \ + html += article["article_date"].ctime() + " - " + \ """%s%s%s%s""" % \ (feed_id, article["article_id"], not_read_begin, \ article["article_title"][:150], not_read_end, description) + like + "
\n" @@ -789,7 +789,7 @@ class Root: # a description line per article (date, title of the article and # CSS description tooltips on mouse over) - html += str(article["article_date"]) + " - " + \ + html += article["article_date"].ctime() + " - " + \ """%s%s
\n""" % \ (feed["feed_id"], article["article_id"], article["article_title"][:150], description) @@ -818,7 +818,7 @@ class Root: # a description line per article (date, title of the article and # CSS description tooltips on mouse over) - html += str(article["article_date"]) + " - " + \ + html += article["article_date"].ctime() + " - " + \ """%s%s
\n""" % \ (feed_id, article["article_id"], article["article_title"][:150], description) @@ -904,8 +904,7 @@ class Root: target="_blank">\n""" % \ (feed["feed_id"], feed["feed_link"], feed["feed_title"], feed["feed_link"], feed["feed_image"]) - html += str(article["article_date"]).split(' ')[0][-2:] + " (" + \ - str(article["article_date"]).split(' ')[1] + ") - " + \ + html += article["article_date"].strftime("%a %d (%H:%M:%S) ") + \ """%s%s%s%s""" % \ (feed["feed_id"], article["article_id"], not_read_begin, \ article_title, not_read_end, description) + like + "
\n" @@ -1069,7 +1068,7 @@ class Root: # a description line per article (date, title of the article and # CSS description tooltips on mouse over) - html += str(article["article_date"]) + " - " + \ + html += article["article_date"].ctime() + " - " + \ """%s%s
\n""" % \ (feed["feed_id"], article["article_id"], article["article_title"][:150], description) html += "
\n" -- cgit