py3: ported PartDesign to python3

This commit is contained in:
wmayer
2016-01-23 19:04:27 +01:00
committed by looooo
parent da1081bc98
commit 381419c267
3 changed files with 14 additions and 9 deletions

View File

@@ -97,11 +97,11 @@ PyObject* initModule()
/* Python entry */
PyMODINIT_FUNC initPartDesignGui()
PyMOD_INIT_FUNC(PartDesignGui)
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
return;
PyMOD_Return(0);
}
try {
@@ -110,10 +110,10 @@ PyMODINIT_FUNC initPartDesignGui()
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
return;
PyMOD_Return(0);
}
(void)PartDesignGui::initModule();
PyObject* mod = PartDesignGui::initModule();
Base::Console().Log("Loading GUI of PartDesign module... done\n");
// instantiating the commands
@@ -154,4 +154,6 @@ PyMODINIT_FUNC initPartDesignGui()
// add resources and reloads the translators
loadPartDesignResource();
PyMOD_Return(mod);
}