py3: ported Path to python3

This commit is contained in:
wmayer
2016-01-23 21:59:22 +01:00
committed by looooo
parent 94fe93aeb7
commit 762f1bcb9e
6 changed files with 70 additions and 8 deletions

View File

@@ -51,11 +51,11 @@ extern PyObject* initModule();
}
/* Python entry */
PyMODINIT_FUNC initPathGui()
PyMOD_INIT_FUNC(PathGui)
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
return;
PyMOD_Return(0);
}
try {
Base::Interpreter().runString("import PartGui");
@@ -63,9 +63,9 @@ PyMODINIT_FUNC initPathGui()
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
return;
PyMOD_Return(0);
}
(void)PathGui::initModule();
PyObject* mod = PathGui::initModule();
Base::Console().Log("Loading GUI of Path module... done\n");
// instantiating the commands
@@ -83,4 +83,6 @@ PyMODINIT_FUNC initPathGui()
// register preferences pages
new Gui::PrefPageProducer<PathGui::DlgSettingsPathColor> ("Path");
PyMOD_Return(mod);
}