diff --git a/bson/json_util.py b/bson/json_util.py index b7d46a5db..e200ced8d 100644 --- a/bson/json_util.py +++ b/bson/json_util.py @@ -131,9 +131,9 @@ def loads(s, *args, **kwargs): Automatically passes the object_hook for BSON type conversion. :Parameters: - - `compile_re` (optional): if ``False``, don't attempt to compile - BSON regular expressions into Python regular expressions. Return - instances of :class:`~bson.bsonregex.BSONRegex` instead. + - `compile_re` (optional): if ``False``, don't attempt to compile BSON + regular expressions into Python regular expressions. Return instances + of :class:`~bson.bsonregex.BSONRegex` instead. .. versionchanged:: 2.7 Added ``compile_re`` option. diff --git a/doc/tools.rst b/doc/tools.rst index 411cac9c5..4688e0437 100644 --- a/doc/tools.rst +++ b/doc/tools.rst @@ -83,8 +83,8 @@ MotorEngine `MotorEngine `_ is a port of MongoEngine to Motor, for asynchronous access with Tornado. It implements the same modeling APIs to be data-portable, meaning that a - model defined in MongoEngine can be read in MotorEngine. The source `is on - github `_. + model defined in MongoEngine can be read in MotorEngine. The source is + `available on github `_. Framework Tools --------------- diff --git a/gridfs/__init__.py b/gridfs/__init__.py index a505db01d..c60179d5d 100644 --- a/gridfs/__init__.py +++ b/gridfs/__init__.py @@ -105,7 +105,7 @@ class GridFS(object): try: f = new_file(**kwargs) f.write(data) - finally + finally: f.close() `data` can be either an instance of :class:`str` (:class:`bytes` @@ -284,18 +284,18 @@ class GridFS(object): Returns a cursor that iterates across files matching arbitrary queries on the files collection. Can be combined - with other modifiers for additional control. For example + with other modifiers for additional control. For example:: - >>> for grid_out in fs.find({"filename": "lisa.txt"}, timeout=False): - >>> data = grid_out.read() + for grid_out in fs.find({"filename": "lisa.txt"}, timeout=False): + data = grid_out.read() would iterate through all versions of "lisa.txt" stored in GridFS. Note that setting timeout to False may be important to prevent the cursor from timing out during long multi-file processing work. - As another example, the call + As another example, the call:: - >>> most_recent_three = fs.find().sort("uploadDate", -1).limit(3) + most_recent_three = fs.find().sort("uploadDate", -1).limit(3) would return a cursor to the three most recently uploaded files in GridFS.