| Conditions | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | """ |
||
| 9 | def parse_params(*arguments): |
||
| 10 | """ |
||
| 11 | Parse the parameters |
||
| 12 | Forward them to the wrapped function as named parameters |
||
| 13 | """ |
||
| 14 | def parse(func): |
||
| 15 | """ Wrapper """ |
||
| 16 | @wraps(func) |
||
| 17 | def resource_verb(*args, **kwargs): |
||
| 18 | """ Decorated function """ |
||
| 19 | parser = reqparse.RequestParser() |
||
| 20 | for argument in arguments: |
||
| 21 | parser.add_argument(argument) |
||
| 22 | kwargs.update(parser.parse_args()) |
||
| 23 | return func(*args, **kwargs) |
||
| 24 | return resource_verb |
||
| 25 | return parse |
||
| 26 |