

def makeCallable(self, func, interval=0, name=None, expose=False):
    function_name = BaseServer.makeCallable(self, func, interval=interval, name=name, expose=expose)
    if expose:
        self.exposed_functions.append(function_name)
        er = ExposedResource(self, function_name)
        function_name_parts = function_name.split('/')
        if (len(function_name_parts) > 1):
            if (function_name_parts[0] in self.exposed_function_resources):
                r = self.exposed_function_resources[function_name_parts[0]]
            else:
                r = Resource()
                self.exposed_function_resources[function_name_parts[0]] = r
            self.function_resource.putChild(function_name_parts[0], r)
            r.putChild(function_name_parts[1], er)
        else:
            self.function_resource.putChild(function_name_parts[0], er)
        LOGGER.info(('Function %s is now available via the HTTP interface.' % function_name))

dataset/ETHPy150Open wehriam/awspider/awspider/servers/interface.py InterfaceServer.makeCallable/original