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

Method __call__

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

Source from the content-addressed store, hash-verified

426 self.route["exclude"] = (exclude,) if not isinstance(exclude, (list, tuple)) else exclude
427
428 def __call__(self, api_function):
429 api = self.route.get("api", hug.api.from_object(api_function))
430 (interface, callable_method) = self._create_interface(
431 api, api_function, catch_exceptions=False
432 )
433 for version in self.route.get("versions", (None,)):
434 for exception in self.route["exceptions"]:
435 api.http.add_exception_handler(exception, interface, version)
436
437 return callable_method
438
439 def _create_interface(self, api, api_function, catch_exceptions=False):
440 interface = hug.interface.ExceptionRaised(self.route, api_function, catch_exceptions)

Callers

nothing calls this directly

Calls 3

_create_interfaceMethod · 0.95
add_exception_handlerMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected