py3: ported Spreadsheet to python3

This commit is contained in:
wmayer
2016-01-23 19:52:37 +01:00
parent f9cb89a9cb
commit 3d3a8d0141
3 changed files with 72 additions and 7 deletions

View File

@@ -93,15 +93,21 @@ private:
return Py::None();
}
};
PyObject* initModule()
{
return (new Module)->module().ptr();
}
} // namespace SpreadsheetGui
/* Python entry */
PyMODINIT_FUNC initSpreadsheetGui()
PyMOD_INIT_FUNC(SpreadsheetGui)
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
return;
PyMOD_Return(0);
}
// instantiating the commands
@@ -114,6 +120,7 @@ PyMODINIT_FUNC initSpreadsheetGui()
// add resources and reloads the translators
loadSpreadsheetResource();
new SpreadsheetGui::Module();
PyObject* mod = SpreadsheetGui::initModule();
Base::Console().Log("Loading GUI of Spreadsheet module... done\n");
PyMOD_Return(mod);
}