py3: ported module init to python3

This commit is contained in:
wmayer
2016-01-23 15:30:29 +01:00
parent 915a1b18c4
commit 76b3397762
11 changed files with 92 additions and 37 deletions

View File

@@ -100,6 +100,12 @@ private:
return Py::None();
}
};
PyObject* initModule()
{
return (new Module())->module().ptr();
}
} // namespace WebGui
@@ -108,10 +114,10 @@ PyMODINIT_FUNC initWebGui()
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
return;
PyMOD_Return(0);
}
new WebGui::Module();
PyObject* mod = WebGui::initModule();
Base::Console().Log("Loading GUI of Web module... done\n");
// instantiating the commands
@@ -120,4 +126,6 @@ PyMODINIT_FUNC initWebGui()
// add resources and reloads the translators
loadWebResource();
PyMOD_Return(mod);
}