MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / object_to_string

Function object_to_string

src/python/lfs/py_ui_menus.cpp:62–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 }
61
62 std::string object_to_string(const nb::object& obj, const std::string& fallback = "") {
63 if (!obj.is_valid() || obj.is_none())
64 return fallback;
65 try {
66 return nb::cast<std::string>(obj);
67 } catch (...) {
68 return fallback;
69 }
70 }
71
72 bool object_to_bool(const nb::object& obj, bool fallback = false) {
73 if (!obj.is_valid() || obj.is_none())

Callers 7

is_separator_itemFunction · 0.85
is_submenu_itemFunction · 0.85
is_operator_itemFunction · 0.85
callback_item_typeFunction · 0.85
collect_schema_itemsFunction · 0.85
execute_schema_callbackFunction · 0.85
draw_schema_menu_itemsFunction · 0.85

Calls 1

is_validMethod · 0.45

Tested by

no test coverage detected