+ simplify porting of Fem module to Python3

This commit is contained in:
wmayer
2016-01-21 13:42:08 +01:00
parent 094a4352f1
commit bf10bf33f6
4 changed files with 202 additions and 528 deletions

View File

@@ -54,14 +54,12 @@
#include "FemResultObject.h"
#include "FemSolverObject.h"
extern struct PyMethodDef Fem_methods[];
PyDoc_STRVAR(module_Fem_doc,
"This module is the FEM module.");
namespace Fem {
extern PyObject* initModule();
}
/* Python entry */
extern "C" {
void AppFemExport initFem()
PyMODINIT_FUNC initFem()
{
// load dependend module
try {
@@ -72,7 +70,7 @@ void AppFemExport initFem()
PyErr_SetString(PyExc_ImportError, e.what());
return;
}
PyObject* femModule = Py_InitModule3("Fem", Fem_methods, module_Fem_doc); /* mod name, table ptr */
PyObject* femModule = Fem::initModule();
Base::Console().Log("Loading Fem module... done\n");
Fem::StdMeshers_Arithmetic1DPy ::init_type(femModule);
@@ -146,5 +144,3 @@ void AppFemExport initFem()
Fem::FemSolverObject ::init();
Fem::FemSolverObjectPython ::init();
}
} // extern "C"