From a88c83001f2e80fb175a5f346935554baba269ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bisinger?= Date: Fri, 15 May 2015 18:16:36 +0200 Subject: [PATCH] Fix wrong reference to status argument in the docs Fix the documentation where it sais that wsme.signature takes a status argument: the actual name of the argument is status_code. Closes-Bug: #1455563 Change-Id: Ifa3abef5654e5b796285a467fe5e6bce248ef60c --- doc/api.rst | 2 +- wsme/api.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 1297915..dc61f98 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -9,7 +9,7 @@ Public API .. module:: wsme -.. autoclass:: signature([return_type, [arg0_type, [arg1_type, ... ] ] ], body=None, status=None) +.. autoclass:: signature([return_type, [arg0_type, [arg1_type, ... ] ] ], body=None, status_code=None) .. autoclass:: wsme.types.Base .. autoclass:: wsattr diff --git a/wsme/api.py b/wsme/api.py index bd4631f..4aab9a4 100644 --- a/wsme/api.py +++ b/wsme/api.py @@ -141,14 +141,14 @@ class FunctionDefinition(object): class signature(object): - """ - Decorator that specify the argument types of an exposed function. + + """Decorator that specify the argument types of an exposed function. :param return_type: Type of the value returned by the function :param argN: Type of the Nth argument :param body: If the function takes a final argument that is supposed to be the request body by itself, its type. - :param status: HTTP return status code of the function. + :param status_code: HTTP return status code of the function. :param ignore_extra_args: Allow extra/unknow arguments (default to False) Most of the time this decorator is not supposed to be used directly, @@ -158,6 +158,7 @@ class signature(object): decororator, either a new decorator named @wsexpose that takes the same parameters (it will in addition expose the function, hence its name). """ + def __init__(self, *types, **options): self.return_type = types[0] if types else None self.arg_types = []