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

Method getEditorMode

src/App/PropertyContainerPyImp.cpp:364–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364PyObject* PropertyContainerPy::getEditorMode(PyObject* args)
365{
366 char* name {};
367 if (!PyArg_ParseTuple(args, "s", &name)) {
368 return nullptr;
369 }
370
371 App::Property* prop = getPropertyContainerPtr()->getPropertyByName(name);
372 if (!prop) {
373 PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", name);
374 return nullptr;
375 }
376
377 Py::List ret;
378 if (prop) {
379 short Type = prop->getType();
380 if ((prop->testStatus(Property::ReadOnly)) || (Type & Prop_ReadOnly)) {
381 ret.append(Py::String("ReadOnly"));
382 }
383 if ((prop->testStatus(Property::Hidden)) || (Type & Prop_Hidden)) {
384 ret.append(Py::String("Hidden"));
385 }
386 }
387 return Py::new_reference_to(ret);
388}
389
390PyObject* PropertyContainerPy::getGroupOfProperty(PyObject* args)
391{

Callers

nothing calls this directly

Calls 6

new_reference_toFunction · 0.85
StringClass · 0.70
getPropertyByNameMethod · 0.45
getTypeMethod · 0.45
testStatusMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected