Skip to content

Commit

Permalink
Reflow docs
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed May 27, 2015
1 parent 4c8f54d commit 296e38c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/web.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Routes may have a *name*::
In web-handler you may build *URL* for that route::

>>> request.app.router['root'].url(query="?a=b&c=d")
... '/root?a=b&c=d'
'/root?a=b&c=d'

More interesting example is building *URL* for :ref:`variable
router<aiohttp-web-variable-handler>`::
Expand All @@ -121,9 +121,10 @@ router<aiohttp-web-variable-handler>`::

In this case you can pass route parameters also::

>>> request.app.router['handler'].url(params={'user': 'john_doe'},
query="?a=b")
... '/john_doe/info?a=b'
>>> request.app.router['handler'].url(
... params={'user': 'john_doe'},
... query="?a=b")
'/john_doe/info?a=b'


Using plain coroutines and classes for web-handlers
Expand Down Expand Up @@ -412,7 +413,8 @@ using response's methods:
elif msg.tp == aiohttp.MsgType.close:
print('websocket connection closed')
elif msg.tp == aiohttp.MsgType.error:
print('ws connection closed with exception %s', ws.exception())
print('ws connection closed with exception %s',
ws.exception())
return ws
Expand Down

0 comments on commit 296e38c

Please sign in to comment.