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

Method setCustomAttributes

src/App/PropertyContainerPyImp.cpp:661–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661int PropertyContainerPy::setCustomAttributes(const char* attr, PyObject* obj)
662{
663 // search in PropertyList
664 Property* prop = getPropertyContainerPtr()->getPropertyByName(attr);
665 if (prop) {
666 // Read-only attributes must not be set over its Python interface
667 if (prop->testStatus(Property::Immutable)) {
668 std::stringstream s;
669 s << "Object attribute '" << attr << "' is read-only";
670 throw Py::AttributeError(s.str());
671 }
672
673 FC_TRACE("Set property " << prop->getFullName());
674 prop->setPyObject(obj);
675 return 1;
676 }
677
678 return 0;
679}
680
681PyObject* PropertyContainerPy::renameProperty(PyObject* args) const
682{

Callers

nothing calls this directly

Calls 5

getPropertyByNameMethod · 0.45
testStatusMethod · 0.45
strMethod · 0.45
getFullNameMethod · 0.45
setPyObjectMethod · 0.45

Tested by

no test coverage detected