| 188 | } |
| 189 | |
| 190 | void FeaturePythonImp::onChanged(const Property* prop) |
| 191 | { |
| 192 | if (py_onChanged.isNone()) { |
| 193 | return; |
| 194 | } |
| 195 | // Run the execute method of the proxy object. |
| 196 | Base::PyGILStateLocker lock; |
| 197 | try { |
| 198 | const char* prop_name = object->getPropertyName(prop); |
| 199 | if (!prop_name) { |
| 200 | return; |
| 201 | } |
| 202 | if (has__object__) { |
| 203 | Py::Tuple args(1); |
| 204 | args.setItem(0, Py::String(prop_name)); |
| 205 | Base::pyCall(py_onChanged.ptr(), args.ptr()); |
| 206 | } |
| 207 | else { |
| 208 | Py::Tuple args(2); |
| 209 | args.setItem(0, Py::Object(object->getPyObject(), true)); |
| 210 | args.setItem(1, Py::String(prop_name)); |
| 211 | Base::pyCall(py_onChanged.ptr(), args.ptr()); |
| 212 | } |
| 213 | } |
| 214 | catch (Py::Exception&) { |
| 215 | Base::PyException e; // extract the Python error text |
| 216 | e.reportException(); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | void FeaturePythonImp::onDocumentRestored() |
| 221 | { |
nothing calls this directly
no test coverage detected