aboutsummaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2011-07-07 18:21:38 +0200
committercedricbonhomme <devnull@localhost>2011-07-07 18:21:38 +0200
commit4294c12669e0fa1d578c03dd344ad05a95218cb1 (patch)
tree91059f4c2b39fad7e7d7cc065c390dd25206c251 /utils.py
parentMinor bugfix: When using the control script the main process was attached to ... (diff)
downloadnewspipe-4294c12669e0fa1d578c03dd344ad05a95218cb1.tar.gz
newspipe-4294c12669e0fa1d578c03dd344ad05a95218cb1.tar.bz2
newspipe-4294c12669e0fa1d578c03dd344ad05a95218cb1.zip
reinitialize sha1.update() before each hash.
Diffstat (limited to 'utils.py')
-rwxr-xr-xutils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils.py b/utils.py
index 74519161..e145b6b2 100755
--- a/utils.py
+++ b/utils.py
@@ -400,7 +400,6 @@ def load_feed():
feeds = OrderedDict()
if list_of_feeds != []:
- sha1_hash = hashlib.sha1()
# Case-insensitive sorting
tupleList = [(x[0].lower(), x) for x in list_of_feeds]
tupleList.sort(key=operator.itemgetter(0))
@@ -410,7 +409,7 @@ def load_feed():
list_of_articles = c.execute(\
"SELECT * FROM articles WHERE feed_link='" + \
feed[2] + "'").fetchall()
-
+ sha1_hash = hashlib.sha1()
sha1_hash.update(feed[2].encode('utf-8'))
feed_id = sha1_hash.hexdigest()
@@ -426,9 +425,10 @@ def load_feed():
if list_of_articles != []:
list_of_articles.sort(lambda x,y: compare(y[0], x[0]))
if MAX_NB_ARTICLES != -1:
- list_of_articles = list_of_articles[:MAX_NB_ARTICLES]
+ list_of_articles = list_of_articles[:MAX_NB_ARTICLES]
# Walk through the list of articles for the current feed.
for article in list_of_articles:
+ sha1_hash = hashlib.sha1()
sha1_hash.update(article[2].encode('utf-8'))
article_id = sha1_hash.hexdigest()
bgstack15