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",