Applied black

This commit is contained in:
Simon Willison 2019-06-16 08:43:58 -07:00
commit d736411699

View file

@ -78,24 +78,18 @@ class AsgiRouter:
async def hello_world(scope, receive, send): async def hello_world(scope, receive, send):
assert scope['type'] == 'http' assert scope["type"] == "http"
await send({ await send(
'type': 'http.response.start', {
'status': 200, "type": "http.response.start",
'headers': [ "status": 200,
[b'content-type', b'text/html'], "headers": [[b"content-type", b"text/html"]],
] }
}) )
await send({ await send({"type": "http.response.body", "body": b"<h1>Hello world!</h1>"})
'type': 'http.response.body',
'body': b'<h1>Hello world!</h1>',
})
app = AsgiRouter([("/hello/", hello_world)])
app = AsgiRouter([
('/hello/', hello_world),
])
class AsgiView(HTTPMethodView): class AsgiView(HTTPMethodView):