def get(self, file_id, callback): """Get a file from GridFS by ``"_id"``. Returns an instance of :class:`~gridfs.grid_file.GridOut`, which provides a file-like interface for reading. :Parameters: - `file_id`: ``"_id"`` of the file to get .. versionadded:: 1.6 """ GridOut.instance_for(self.__collection, callback, file_id)
def mod_callback(response): if len(response) > 0: GridOut.instance_for(self.__collection, callback, file_document=response[0]) else: callback(None)