Core: Add beforeDelete python interface.
This commit is contained in:
@@ -759,6 +759,32 @@ void ViewProviderFeaturePythonImp::finishRestoring()
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderFeaturePythonImp::beforeDelete()
|
||||
{
|
||||
_FC_PY_CALL_CHECK(beforeDelete, return);
|
||||
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
if (has__object__) {
|
||||
Base::pyCall(py_beforeDelete.ptr());
|
||||
}
|
||||
else {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Object(object->getPyObject(), true));
|
||||
Base::pyCall(py_beforeDelete.ptr(), args.ptr());
|
||||
}
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
|
||||
PyErr_Clear();
|
||||
}
|
||||
else {
|
||||
Base::PyException e;
|
||||
e.reportException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ViewProviderFeaturePythonImp::ValueT
|
||||
ViewProviderFeaturePythonImp::onDelete(const std::vector<std::string> & sub)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user