diff options
author | Stéphane Bisinger <stephane.bisinger@gmail.com> | 2015-05-15 18:16:36 +0200 |
---|---|---|
committer | Lucas Alvares Gomes <lucasagomes@gmail.com> | 2015-05-26 17:29:45 +0000 |
commit | a88c83001f2e80fb175a5f346935554baba269ef (patch) | |
tree | 737484a731a14bfaaf88786e7f3bccd0fe578a98 | |
parent | f28ec1354e2ef1a92cd7eaf5e7c363e2107280ce (diff) | |
download | wsme-a88c83001f2e80fb175a5f346935554baba269ef.tar.gz |
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
-rw-r--r-- | doc/api.rst | 2 | ||||
-rw-r--r-- | 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 = [] |