diff options
author | cedricbonhomme <devnull@localhost> | 2012-11-08 23:08:35 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2012-11-08 23:08:35 +0100 |
commit | 901fbd154f16268ca4c9d10af8d038d684c8c4f4 (patch) | |
tree | e131333ad325c6b595345bb16113f1263a57d9dc /source/mongodb.py | |
parent | HTML username text input is now focused by default. (diff) | |
download | newspipe-901fbd154f16268ca4c9d10af8d038d684c8c4f4.tar.gz newspipe-901fbd154f16268ca4c9d10af8d038d684c8c4f4.tar.bz2 newspipe-901fbd154f16268ca4c9d10af8d038d684c8c4f4.zip |
Porting to Python 3.2. Better, faster, stronger.
Diffstat (limited to 'source/mongodb.py')
-rw-r--r-- | source/mongodb.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/mongodb.py b/source/mongodb.py index e83b7324..68ccf5bc 100644 --- a/source/mongodb.py +++ b/source/mongodb.py @@ -78,7 +78,7 @@ class Articles(object): """ Return information about a feed. """ - return self.db[str(feed_id)].find().next() + return next(self.db[str(feed_id)].find()) def get_all_feeds(self, condition=None): """ @@ -93,7 +93,7 @@ class Articles(object): else: cursor = self.db[collection_name].find({"type":0, condition[0]:condition[1]}) if cursor.count() != 0: - feeds.append(cursor.next()) + feeds.append(next(cursor)) feeds.sort(key = lambda elem: elem['feed_title'].lower()) return feeds @@ -114,7 +114,7 @@ class Articles(object): Get an article of a specified feed. """ collection = self.db[str(feed_id)] - return collection.find({"article_id":article_id}).next() + return next(collection.find({"article_id":article_id})) def get_articles_from_collection(self, feed_id, condition=None, limit=1000000000): """ @@ -270,7 +270,7 @@ if __name__ == "__main__": #articles.add_articles([article_dic1, article_dic2], 42) - print "All articles:" + print("All articles:") #print articles.get_all_articles() |