def __call__(self, func):
        def controller_replacement(environ, start_response, **args):
            req = Request(environ)

            access_response = self.__handle_access(req, environ, start_response)
            if access_response:
                return access_response

            result = self.__execute_request(func, args, req, environ)
            resp = self.__build_response(result)

            return resp(environ, start_response)

        controller_replacement.func = func
        controller_replacement.response_type = self.response_type
        controller_replacement.body = self.body
        controller_replacement.__name__ = func.__name__
        controller_replacement.__controller__ = True
        controller_replacement.__method__ = self.method
        controller_replacement.__path__ = self.path or "/%s" % func.__name__
        return controller_replacement
dataset/ETHPy150Open galaxyproject/pulsar/pulsar/web/framework.py/Controller.__call__/original