From fae1ffed838e571b644d7ece4ac0f9fa9401641f Mon Sep 17 00:00:00 2001 From: Uwe Date: Mon, 21 Mar 2022 14:00:13 +0100 Subject: [PATCH] [JtReader] fixes to make it compilable --- src/Mod/JtReader/App/AppJtReaderPy.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Mod/JtReader/App/AppJtReaderPy.cpp b/src/Mod/JtReader/App/AppJtReaderPy.cpp index 521482f44a..025ffa45c9 100644 --- a/src/Mod/JtReader/App/AppJtReaderPy.cpp +++ b/src/Mod/JtReader/App/AppJtReaderPy.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -96,18 +97,14 @@ open(PyObject * /*self*/, PyObject *args) // extract ending if(file.extension() == "") - Py_Error(Base::BaseExceptionFreeCADError,"no file ending"); + Py_Error(Base::PyExc_FC_GeneralError, "no file ending"); if(file.hasExtension("jt")) { - TestJtReader reader; - reader.setFile(EncodedName.c_str()); - reader.read(); - // create new document and add Import feature // App::Document *pcDoc = App::GetApplication().newDocument("Unnamed"); // Mesh::Feature *pcFeature = (Mesh::Feature*)pcDoc->addObject("Mesh::Feature",file.fileNamePure().c_str()); @@ -143,7 +140,7 @@ open(PyObject * /*self*/, PyObject *args) } else { - Py_Error(Base::BaseExceptionFreeCADError,"unknown file ending"); + Py_Error(Base::PyExc_FC_GeneralError, "unknown file ending"); } @@ -170,7 +167,7 @@ insert(PyObject * /*self*/, PyObject *args) // extract ending if(file.extension() == "") - Py_Error(Base::BaseExceptionFreeCADError,"no file ending"); + Py_Error(Base::PyExc_FC_GeneralError, "no file ending"); if(file.hasExtension("jt") ) { @@ -180,7 +177,7 @@ insert(PyObject * /*self*/, PyObject *args) { char szBuf[200]; snprintf(szBuf, 200, "Import called to the non-existing document '%s'", DocName); - Py_Error(Base::BaseExceptionFreeCADError,szBuf); + Py_Error(Base::PyExc_FC_GeneralError, szBuf); } //readFile(EncodedName.c_str(),0); @@ -222,7 +219,7 @@ insert(PyObject * /*self*/, PyObject *args) } else { - Py_Error(Base::BaseExceptionFreeCADError,"unknown file ending"); + Py_Error(Base::PyExc_FC_GeneralError, "unknown file ending"); } } PY_CATCH; @@ -233,10 +230,8 @@ insert(PyObject * /*self*/, PyObject *args) /* registration table */ struct PyMethodDef JtReader_methods[] = { - {"open" ,open , Py_NEWARGS, "open a jt file in a new Document"}, + {"open" ,open , Py_NEWARGS, "open a jt file in a new Document"}, {"insert" ,insert, Py_NEWARGS, "isert a jt file in a existing document"}, {"read" ,read, Py_NEWARGS, "Read a Mesh from a jt file and returns a Mesh object."}, - {NULL, NULL, 0, NULL} + {NULL, NULL, 0, NULL} }; - -