MCPcopy Index your code
hub / github.com/hugapi/hug / __call__

Method __call__

hug/routing.py:368–373  ·  view source on GitHub ↗
(self, api_function)

Source from the content-addressed store, hash-verified

366 self.route["urls"] = (urls,) if isinstance(urls, str) else urls
367
368 def __call__(self, api_function):
369 api = self.route.get("api", hug.api.from_object(api_function))
370 (interface, callable_method) = self._create_interface(api, api_function)
371 for base_url in self.route.get("urls", ("/{0}".format(api_function.__name__),)):
372 api.http.add_sink(interface, base_url)
373 return callable_method
374
375
376class StaticRouter(SinkRouter):

Callers

nothing calls this directly

Calls 3

add_sinkMethod · 0.80
getMethod · 0.45
_create_interfaceMethod · 0.45

Tested by

no test coverage detected