MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getDocumentationOfProperty

Method getDocumentationOfProperty

src/App/PropertyContainerPyImp.cpp:432–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430 Py_Return;
431 }
432 PY_CATCH
433}
434
435
436PyObject* PropertyContainerPy::getDocumentationOfProperty(PyObject* args)
437{
438 char* pstr {};
439 if (!PyArg_ParseTuple(args, "s", &pstr)) {
440 return nullptr;
441 }
442
443 Property* prop = getPropertyContainerPtr()->getPropertyByName(pstr);
444 if (!prop) {
445 PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", pstr);
446 return nullptr;
447 }
448
449 const char* docstr = getPropertyContainerPtr()->getPropertyDocumentation(prop);
450 if (docstr) {
451 return Py::new_reference_to(Py::String(docstr));
452 }
453 else {
454 return Py::new_reference_to(Py::String(""));
455 }
456}
457
458PyObject* PropertyContainerPy::setDocumentationOfProperty(PyObject* args)
459{

Callers

nothing calls this directly

Calls 4

new_reference_toFunction · 0.85
StringClass · 0.70
getPropertyByNameMethod · 0.45

Tested by

no test coverage detected