MCPcopy Create free account
hub / github.com/Ar-Ray-code/lingbot-depth-trt / _safe_call

Function _safe_call

python/scripts/camera/orbbec.py:24–31  ·  view source on GitHub ↗
(obj: Any, method_name: str)

Source from the content-addressed store, hash-verified

22
23
24def _safe_call(obj: Any, method_name: str) -> str | None:
25 if not hasattr(obj, method_name):
26 return None
27 try:
28 value = getattr(obj, method_name)()
29 except Exception:
30 return None
31 return str(value)
32
33
34def _device_info(device: Any, index: int) -> DeviceInfo:

Callers 1

_device_infoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected