aboutsummaryrefslogtreecommitdiff
path: root/pyAggr3g470r.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-02-06 20:38:27 +0100
committercedricbonhomme <devnull@localhost>2010-02-06 20:38:27 +0100
commitad17f49157b8c255d5b289b4c73a8cdd37a30436 (patch)
tree7e0cfda10e91be4eb39d518ea9427e108087cfb6 /pyAggr3g470r.py
parentBug fix : there was a problem with utf-8 in the SQLite3 database with Python ... (diff)
downloadnewspipe-ad17f49157b8c255d5b289b4c73a8cdd37a30436.tar.gz
newspipe-ad17f49157b8c255d5b289b4c73a8cdd37a30436.tar.bz2
newspipe-ad17f49157b8c255d5b289b4c73a8cdd37a30436.zip
Improvement. Tuple are remplaced by list of articles in order to update self.dic faster (without having to reload from the database).
Diffstat (limited to 'pyAggr3g470r.py')
-rw-r--r--pyAggr3g470r.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index a446ca0b..d96be7db 100644
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -87,8 +87,8 @@ class Root:
not_read_end = ""
html += article[1].encode('utf-8') + \
- not_read_begin + \
- """ - <a href="/description/%s" rel="noreferrer" target="_blank">%s</a>""" % \
+ " - " + not_read_begin + \
+ """<a href="/description/%s" rel="noreferrer" target="_blank">%s</a>""" % \
(article[0].encode('utf-8'), article[2].encode('utf-8')) + \
not_read_end + \
"<br />\n"
@@ -130,7 +130,7 @@ class Root:
if article[7] == "0":
self.mark_as_read(article[3]) # update the database
- article[7] == 1 # avoids to reload self.dic
+ article[7] = "1" # avoids to reload self.dic
html += """<h1><i>%s</i> from <a href="/all_articles/%s">%s</a></h1><br />""" % \
(article[2].encode('utf-8'), rss_feed_id, article[5].encode('utf-8'))
@@ -163,8 +163,8 @@ class Root:
not_read_end = ""
html += article[1].encode('utf-8') + \
- not_read_begin + \
- """ - <a href="/description/%s" rel="noreferrer" target="_blank">%s</a>""" % \
+ " - " + not_read_begin + \
+ """<a href="/description/%s" rel="noreferrer" target="_blank">%s</a>""" % \
(article[0].encode('utf-8'), article[2].encode('utf-8')) + \
not_read_end + \
"<br />\n"
@@ -225,13 +225,13 @@ class Root:
sha256_hash.update(article[2].encode('utf-8'))
article_id = sha256_hash.hexdigest()
- article_tuple = (article_id, article[0], article[1], \
- article[2], article[3], article[4], article[5], article[6])
+ article_list = [article_id, article[0], article[1], \
+ article[2], article[3], article[4], article[5], article[6]]
if feed_id not in dic:
- dic[feed_id] = [article_tuple]
+ dic[feed_id] = [article_list]
else:
- dic[feed_id].append(article_tuple)
+ dic[feed_id].append(article_list)
# sort articles by date for each feeds
for feeds in dic.keys():
bgstack15