App: Add support for <pythonmin> XML tag in metadata

This commit is contained in:
Chris Hennes
2022-09-25 14:25:04 -05:00
parent 849305b88a
commit 0a95fbb258
4 changed files with 44 additions and 4 deletions

View File

@@ -864,6 +864,21 @@ void MetadataPy::setFreeCADMax(Py::Object args)
getMetadataPtr()->setFreeCADMax(App::Meta::Version());
}
Py::Object MetadataPy::getPythonMin() const
{
return Py::String(getMetadataPtr()->pythonmin().str());
}
void MetadataPy::setPythonMin(Py::Object args)
{
char *version = nullptr;
PyObject *p = args.ptr();
if (!PyArg_Parse(p, "z", &version)) throw Py::Exception();
if (version) getMetadataPtr()->setPythonMin(App::Meta::Version(version));
else
getMetadataPtr()->setPythonMin(App::Meta::Version());
}
PyObject *MetadataPy::getFirstSupportedFreeCADVersion(PyObject *p)
{
if (!PyArg_ParseTuple(p, ""))