def __init__(self, context_creators=None, response_processor=None, view_func=None, decorators=None): """ :type context_creators: list[ContextCreator] | list[(env, **kwargs) -> dict] :type response_processor: flask_frontend.common.view_helpers.response_processors.ResponseProcessor | callable(response, dict) :type view_func: (env, **kwargs) -> (dict | flask.Response) :type decorators: list[(func1) -> func2] """ self.decorators = decorators or [] self.response_processor = response_processor self.context_creators = to_iter(context_creators) if context_creators else [] self.view_func = view_func or empty_func self.view_func_args = get_true_argspec(self.view_func)[0]
def __call__(self, f): self.view_func = self._get_function(f) self.view_func_args = get_true_argspec(self.view_func)[0] return self