From 633464273143ea3ecbd447d7bddd132db5c1a697 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 26 Jun 2018 09:39:26 +0100 Subject: [PATCH] Black formatting --- starlette/routing.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/starlette/routing.py b/starlette/routing.py index e51519f9..31694b60 100644 --- a/starlette/routing.py +++ b/starlette/routing.py @@ -13,7 +13,9 @@ class Route: class Path(Route): - def __init__(self, path: str, app: ASGIApp, methods: typing.Sequence[str]=()) -> None: + def __init__( + self, path: str, app: ASGIApp, methods: typing.Sequence[str] = () + ) -> None: self.path = path self.app = app self.methods = methods @@ -32,13 +34,15 @@ class Path(Route): return False, {} def __call__(self, scope: Scope) -> ASGIInstance: - if self.methods and scope['method'] not in self.methods: + if self.methods and scope["method"] not in self.methods: return Response("Method not allowed", 406, media_type="text/plain") return self.app(scope) class PathPrefix(Route): - def __init__(self, path: str, app: ASGIApp, methods: typing.Sequence[str]=()) -> None: + def __init__( + self, path: str, app: ASGIApp, methods: typing.Sequence[str] = () + ) -> None: self.path = path self.app = app self.methods = methods @@ -59,13 +63,13 @@ class PathPrefix(Route): return False, {} def __call__(self, scope: Scope) -> ASGIInstance: - if self.methods and scope['method'] not in self.methods: + if self.methods and scope["method"] not in self.methods: return Response("Method not allowed", 406, media_type="text/plain") return self.app(scope) class Router: - def __init__(self, routes: typing.List[Route], default: ASGIApp=None) -> None: + def __init__(self, routes: typing.List[Route], default: ASGIApp = None) -> None: self.routes = routes self.default = self.not_found if default is None else default