aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-01-20 09:59:57 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-01-20 09:59:57 +0100
commit9dc2753ceece2945bf500e74864c471a1e9bd73d (patch)
treefb67cabaf0cb3c984d5ff41241f9b60301529bc1
parentget_feed() in mongodb.py should test the presence of a collection. (diff)
downloadnewspipe-9dc2753ceece2945bf500e74864c471a1e9bd73d.tar.gz
newspipe-9dc2753ceece2945bf500e74864c471a1e9bd73d.tar.bz2
newspipe-9dc2753ceece2945bf500e74864c471a1e9bd73d.zip
Minor changes in mongodb.py: comments + __main__ section.
-rw-r--r--source/mongodb.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/mongodb.py b/source/mongodb.py
index 358b2746..7879adee 100644
--- a/source/mongodb.py
+++ b/source/mongodb.py
@@ -22,7 +22,7 @@
__author__ = "Cedric Bonhomme"
__version__ = "$Revision: 0.6 $"
__date__ = "$Date: 2012/03/03 $"
-__revision__ = "$Date: 2013/01/11 $"
+__revision__ = "$Date: 2013/01/20 $"
__copyright__ = "Copyright (c) Cedric Bonhomme"
__license__ = "GPLv3"
@@ -74,7 +74,8 @@ class Articles(object):
def get_feed(self, feed_id):
"""
- Return information about a feed.
+ Return information about a feed (collection).
+ Return None if the collection does not exist.
"""
try:
return next(self.db[str(feed_id)].find())
@@ -277,4 +278,4 @@ if __name__ == "__main__":
# Drop the database
- articles.drop_database()
+ #articles.drop_database() \ No newline at end of file
bgstack15