+ 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

@@ -63,20 +63,20 @@ void loadFemResource()
Gui::Translator::instance()->refresh();
}
/* registration table */
extern struct PyMethodDef FemGui_Import_methods[];
namespace FemGui {
extern PyObject* initModule();
}
/* Python entry */
extern "C" {
void FemGuiExport initFemGui()
PyMODINIT_FUNC initFemGui()
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
return;
}
(void) Py_InitModule("FemGui", FemGui_Import_methods); /* mod name, table ptr */
(void) FemGui::initModule();
Base::Console().Log("Loading GUI of Fem module... done\n");
// instantiating the commands
@@ -112,5 +112,3 @@ void FemGuiExport initFemGui()
// add resources and reloads the translators
loadFemResource();
}
} // extern "C" {