Fix docstring formatting errors

This commit is contained in:
Cadel Watson 2017-03-16 16:52:18 +11:00
parent 24f745a334
commit d713533d26
4 changed files with 16 additions and 18 deletions

View File

@ -305,7 +305,7 @@ class Sanic:
the output URL's query string. the output URL's query string.
:param view_name: string referencing the view name :param view_name: string referencing the view name
:param **kwargs: keys and values that are used to build request :param \*\*kwargs: keys and values that are used to build request
parameters and query string arguments. parameters and query string arguments.
:return: the built URL :return: the built URL

View File

@ -251,8 +251,7 @@ def text(body, status=200, headers=None,
:param body: Response data to be encoded. :param body: Response data to be encoded.
:param status: Response code. :param status: Response code.
:param headers: Custom Headers. :param headers: Custom Headers.
:param content_type: :param content_type: the content type (string) of the response
the content type (string) of the response
""" """
return HTTPResponse( return HTTPResponse(
body, status=status, headers=headers, body, status=status, headers=headers,
@ -266,8 +265,7 @@ def raw(body, status=200, headers=None,
:param body: Response data. :param body: Response data.
:param status: Response code. :param status: Response code.
:param headers: Custom Headers. :param headers: Custom Headers.
:param content_type: :param content_type: the content type (string) of the response.
the content type (string) of the response
""" """
return HTTPResponse(body_bytes=body, status=status, headers=headers, return HTTPResponse(body_bytes=body, status=status, headers=headers,
content_type=content_type) content_type=content_type)
@ -316,9 +314,9 @@ def stream(
content_type="text/plain; charset=utf-8"): content_type="text/plain; charset=utf-8"):
"""Accepts an coroutine `streaming_fn` which can be used to """Accepts an coroutine `streaming_fn` which can be used to
write chunks to a streaming response. Returns a `StreamingHTTPResponse`. write chunks to a streaming response. Returns a `StreamingHTTPResponse`.
Example usage:
``` Example usage::
@app.route("/") @app.route("/")
async def index(request): async def index(request):
async def streaming_fn(response): async def streaming_fn(response):
@ -326,7 +324,6 @@ def stream(
await response.write('bar') await response.write('bar')
return stream(streaming_fn, content_type='text/plain') return stream(streaming_fn, content_type='text/plain')
```
:param streaming_fn: A coroutine accepts a response and :param streaming_fn: A coroutine accepts a response and
writes content to that response. writes content to that response.

View File

@ -75,8 +75,9 @@ class Router:
"""Parse a parameter string into its constituent name, type, and """Parse a parameter string into its constituent name, type, and
pattern pattern
For example: For example::
`parse_parameter_string('<param_one:[A-z]>')` ->
parse_parameter_string('<param_one:[A-z]>')` ->
('param_one', str, '[A-z]') ('param_one', str, '[A-z]')
:param parameter_string: String to parse :param parameter_string: String to parse