Base: Standardize on Py::Long type for Python bindings.

This commit is contained in:
tritao
2025-02-07 22:46:35 +00:00
parent 5117c82d33
commit 2145b742eb
44 changed files with 285 additions and 285 deletions

View File

@@ -278,14 +278,14 @@ bool FeaturePythonImp::getSubObject(DocumentObject*& ret,
subname = "";
}
args.setItem(1, Py::String(subname));
args.setItem(2, Py::Int(pyObj ? 2 : 1));
args.setItem(2, Py::Long(pyObj ? 2 : 1));
Base::MatrixPy* pyMat = new Base::MatrixPy(new Base::Matrix4D);
if (_mat) {
*pyMat->getMatrixPtr() = *_mat;
}
args.setItem(3, Py::asObject(pyMat));
args.setItem(4, Py::Boolean(transform));
args.setItem(5, Py::Int(depth));
args.setItem(5, Py::Long(depth));
Py::Object res(Base::pyCall(py_getSubObject.ptr(), args.ptr()));
if (res.isNone()) {
@@ -343,7 +343,7 @@ bool FeaturePythonImp::getSubObjects(std::vector<std::string>& ret, int reason)
try {
Py::Tuple args(2);
args.setItem(0, Py::Object(object->getPyObject(), true));
args.setItem(1, Py::Int(reason));
args.setItem(1, Py::Long(reason));
Py::Object res(Base::pyCall(py_getSubObjects.ptr(), args.ptr()));
if (!res.isTrue()) {
return true;
@@ -390,7 +390,7 @@ bool FeaturePythonImp::getLinkedObject(DocumentObject*& ret,
}
args.setItem(2, Py::asObject(pyMat));
args.setItem(3, Py::Boolean(transform));
args.setItem(4, Py::Int(depth));
args.setItem(4, Py::Long(depth));
Py::Object res(Base::pyCall(py_getLinkedObject.ptr(), args.ptr()));
if (!res.isTrue()) {
@@ -466,7 +466,7 @@ int FeaturePythonImp::isElementVisible(const char* element) const
Py::Tuple args(2);
args.setItem(0, Py::Object(object->getPyObject(), true));
args.setItem(1, Py::String(element ? element : ""));
return Py::Int(Base::pyCall(py_isElementVisible.ptr(), args.ptr()));
return Py::Long(Base::pyCall(py_isElementVisible.ptr(), args.ptr()));
}
catch (Py::Exception&) {
if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
@@ -488,7 +488,7 @@ int FeaturePythonImp::setElementVisible(const char* element, bool visible)
args.setItem(0, Py::Object(object->getPyObject(), true));
args.setItem(1, Py::String(element ? element : ""));
args.setItem(2, Py::Boolean(visible));
return Py::Int(Base::pyCall(py_setElementVisible.ptr(), args.ptr()));
return Py::Long(Base::pyCall(py_setElementVisible.ptr(), args.ptr()));
}
catch (Py::Exception&) {
if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
@@ -568,7 +568,7 @@ int FeaturePythonImp::canLoadPartial() const
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(object->getPyObject(), true));
Py::Int ret(Base::pyCall(py_canLoadPartial.ptr(), args.ptr()));
Py::Long ret(Base::pyCall(py_canLoadPartial.ptr(), args.ptr()));
return ret;
}
catch (Py::Exception&) {