diff options
author | cedricbonhomme <devnull@localhost> | 2012-03-05 19:04:13 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2012-03-05 19:04:13 +0100 |
commit | e9f4078a2cbdba09be8beb6c450f7cbe00d850e3 (patch) | |
tree | 0dcaa0cde3e96d9cc0963a8a63204467da806e6c | |
parent | Case insensitive sorting of collections by dict id. (diff) | |
download | newspipe-e9f4078a2cbdba09be8beb6c450f7cbe00d850e3.tar.gz newspipe-e9f4078a2cbdba09be8beb6c450f7cbe00d850e3.tar.bz2 newspipe-e9f4078a2cbdba09be8beb6c450f7cbe00d850e3.zip |
get_all_articles() now returns a list of dict instead of returning a list of cursors.
-rw-r--r-- | mongodb.py | 2 | ||||
-rwxr-xr-x | pyAggr3g470r.py | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -68,7 +68,7 @@ class Articles(object): collections = self.db.collection_names() for collection_name in collections: collection = self.db[collection_name] - articles.append(collection) + articles.extend([article for article in collection.find({'type':1})]) return articles def get_article(self, feed_id, article_id): diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 9f97e5d6..aba44f49 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -315,13 +315,14 @@ class Root: """ More advanced statistics. """ + articles = self.mongo.get_all_articles() html = htmlheader() html += htmlnav html += """<div class="left inner">\n""" # Some statistics (most frequent word) - if self.feeds: - self.top_words = utils.top_words(self.feeds, n=50, size=int(word_size)) + if articles: + self.top_words = utils.top_words(articles, n=50, size=int(word_size)) html += "<h1>Statistics</h1>\n<br />\n" # Tags cloud html += 'Minimum size of a word:' @@ -677,7 +678,6 @@ class Root: (feed["feed_link"],) dic = {} - #dic[feed.feed_id] = self.feeds[feed.feed_id] top_words = utils.top_words(articles = self.mongo.get_articles_from_collection(feed_id), n=50, size=int(word_size)) html += "</br /><h1>Tag cloud</h1>\n<br />\n" # Tags cloud |