Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 56052ec

Browse files
committed
Adds a doc comment for new_batch_http_request
This comment doesn't actually show up in the generated epydoc, but it does allow the "make docs" command to complete, and it is nice to have the explanation of how to use the method in the source repository. Without this change running "make docs" would have an error: $> make docs cd docs; ./build mkdir -p docs/dyn python describe.py Traceback (most recent call last): File "describe.py", line 388, in <module> document_api(api['name'], api['version']) File "describe.py", line 354, in document_api service, '%s_%s.' % (name, version), discovery, discovery) File "describe.py", line 320, in document_collection_recursive html = document_collection(resource, path, root_discovery, discovery) File "describe.py", line 302, in document_collection params = method_params(doc) File "describe.py", line 192, in method_params doclines = doc.splitlines() AttributeError: 'NoneType' object has no attribute 'splitlines' make: *** [docs] Error 1
1 parent b7f2760 commit 56052ec

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

googleapiclient/discovery.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,19 @@ def _add_basic_methods(self, resourceDesc, rootDesc, schema):
956956
batch_uri = '%s%s' % (
957957
rootDesc['rootUrl'], rootDesc.get('batchPath', 'batch'))
958958
def new_batch_http_request(callback=None):
959+
"""Create a BatchHttpRequest object based on the discovery document.
960+
961+
Args:
962+
callback: callable, A callback to be called for each response, of the
963+
form callback(id, response, exception). The first parameter is the
964+
request id, and the second is the deserialized response object. The
965+
third is an apiclient.errors.HttpError exception object if an HTTP
966+
error occurred while processing the request, or None if no error
967+
occurred.
968+
969+
Returns:
970+
A BatchHttpRequest object based on the discovery document.
971+
"""
959972
return BatchHttpRequest(callback=callback, batch_uri=batch_uri)
960973
self._set_dynamic_attr('new_batch_http_request', new_batch_http_request)
961974

0 commit comments

Comments
 (0)