From 950be14ecaeb46f66154bf8f10fd67b2bb832db7 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 23 Oct 2018 08:00:30 -0400 Subject: [PATCH] Revert "Merge branch 'master' of github.com:kennethreitz/responder" This reverts commit 446deffc17c9aaa845bbe0daa9b516376e9d4ea9, reversing changes made to e0863115ee9770b0e810682ef58810247d43a958. --- .gitignore | 2 +- docs/source/tour.rst | 2 +- responder/routes.py | 5 ++--- setup.py | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index d6482b4..5813b6e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ coverage.xml __pycache__ tests/__pycache__ -*.pyc + build responder.egg-info/ dist/ diff --git a/docs/source/tour.rst b/docs/source/tour.rst index b7462bb..089908a 100644 --- a/docs/source/tour.rst +++ b/docs/source/tour.rst @@ -185,7 +185,7 @@ WebSocket Support Responder supports WebSockets:: - @api.route('/ws', websocket=True) + @api.ws_route('/ws') async def hello(ws): await ws.accept() await ws.send_text("Hello via websocket!") diff --git a/responder/routes.py b/responder/routes.py index fa00975..1183a99 100644 --- a/responder/routes.py +++ b/responder/routes.py @@ -77,9 +77,8 @@ class Route: def is_class_based(self): return hasattr(self.endpoint, "__class__") - @property def is_function(self): - is_callable = callable(self.endpoint) + routed = hasattr(self.endpoint, "is_routed") code = hasattr(self.endpoint, "__code__") kwdefaults = hasattr(self.endpoint, "__kwdefaults__") - return all((is_callable, code, kwdefaults)) + return all((routed, code, kwdefaults)) diff --git a/setup.py b/setup.py index 49a8d54..e92701b 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ required = [ "python-multipart", "chardet", "apispec>=1.0.0b1", - "marshmallow>=3.0.0b7", + "marshmallow", "asgiref", "docopt", "itsdangerous",