App: expose recompute controlling to Python

Add readable-writeable attribute "RecomputesFrozen" to DocumentObject.
This commit is contained in:
DeepSOIC
2017-03-25 17:31:23 +03:00
committed by wmayer
parent fbe3bab74f
commit 66fc40ce58
2 changed files with 16 additions and 0 deletions

View File

@@ -205,6 +205,12 @@ Both parameters are optional.</UserDocu>
</Documentation>
<Parameter Name="Name" Type="String"/>
</Attribute>
<Attribute Name="RecomputesFrozen">
<Documentation>
<UserDocu>Returns or sets if automatic recomputes for this document are disabled.</UserDocu>
</Documentation>
<Parameter Name="RecomputesFrozen" Type="Boolean"/>
</Attribute>
<CustomAttributes />
</PythonExport>
</GenerateModel>

View File

@@ -573,6 +573,16 @@ Py::String DocumentPy::getName(void) const
return Py::String(getDocumentPtr()->getName());
}
Py::Boolean DocumentPy::getRecomputesFrozen(void) const
{
return Py::Boolean(getDocumentPtr()->testStatus(Document::Status::SkipRecompute));
}
void DocumentPy::setRecomputesFrozen(Py::Boolean arg)
{
getDocumentPtr()->setStatus(Document::Status::SkipRecompute, arg.isTrue());
}
PyObject* DocumentPy::getTempFileName(PyObject *args)
{
PyObject *value;