From 1d7a04ce7bff55b1ae8fa7b3a246e7a46bb59187 Mon Sep 17 00:00:00 2001 From: Taoufik Date: Fri, 26 Oct 2018 23:15:13 +0100 Subject: [PATCH 1/2] Fix typo --- responder/api.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/responder/api.py b/responder/api.py index 00a95e9..75b941a 100644 --- a/responder/api.py +++ b/responder/api.py @@ -315,11 +315,9 @@ class API: except Exception: self.default_response(req, resp, error=True) raise - - # Then on_get. + + # Then run on_method. method = req.method - - # Run on_request first. try: # Run the view. r = getattr(view, f"on_{method}", self.no_response)( @@ -343,7 +341,7 @@ class API: return resp def add_event_handler(self, event_type, handler): - """Add a event handler to the API. + """Add an event handler to the API. :param event_type: A string in ("startup", "shutdown") :param handler: The function to run. Can be either a function or a coroutine. From 9abf6eea162d49c68c276f5b2df02c26b6d917bb Mon Sep 17 00:00:00 2001 From: Taoufik Date: Fri, 26 Oct 2018 23:57:16 +0100 Subject: [PATCH 2/2] typo --- responder/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/responder/api.py b/responder/api.py index 75b941a..9c130a1 100644 --- a/responder/api.py +++ b/responder/api.py @@ -341,7 +341,7 @@ class API: return resp def add_event_handler(self, event_type, handler): - """Add an event handler to the API. + """Adds an event handler to the API. :param event_type: A string in ("startup", "shutdown") :param handler: The function to run. Can be either a function or a coroutine. @@ -359,7 +359,7 @@ class API: check_existing=True, websocket=False, ): - """Add a route to the API. + """Adds a route to the API. :param route: A string representation of the route. :param endpoint: The endpoint for the route -- can be a callable, or a class.