py3: ported Import to python3
This commit is contained in:
parent
05544f395c
commit
944d62efc9
|
@ -36,7 +36,7 @@ namespace Import {
|
|||
extern PyObject* initModule();
|
||||
}
|
||||
|
||||
PyMODINIT_FUNC initImport()
|
||||
PyMOD_INIT_FUNC(Import)
|
||||
{
|
||||
PyObject* importModule = Import::initModule();
|
||||
|
||||
|
@ -45,7 +45,7 @@ PyMODINIT_FUNC initImport()
|
|||
}
|
||||
catch(const Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_ImportError, e.what());
|
||||
return;
|
||||
PyMOD_Return(0);
|
||||
}
|
||||
|
||||
// add mesh elements
|
||||
|
@ -55,4 +55,5 @@ PyMODINIT_FUNC initImport()
|
|||
//Import::StepShape ::init();
|
||||
|
||||
Base::Console().Log("Loading Import module... done\n");
|
||||
PyMOD_Return(importModule);
|
||||
}
|
||||
|
|
|
@ -43,23 +43,26 @@ namespace ImportGui {
|
|||
extern PyObject* initModule();
|
||||
}
|
||||
|
||||
PyMODINIT_FUNC initImportGui()
|
||||
PyMOD_INIT_FUNC(ImportGui)
|
||||
{
|
||||
if (!Gui::Application::Instance) {
|
||||
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
|
||||
return;
|
||||
PyMOD_Return(0);
|
||||
}
|
||||
(void)ImportGui::initModule();
|
||||
Base::Console().Log("Loading GUI of Import module... done\n");
|
||||
|
||||
try {
|
||||
Base::Interpreter().loadModule("PartGui");
|
||||
}
|
||||
catch(const Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_ImportError, e.what());
|
||||
return;
|
||||
PyMOD_Return(0);
|
||||
}
|
||||
|
||||
PyObject* mod = ImportGui::initModule();
|
||||
Base::Console().Log("Loading GUI of Import module... done\n");
|
||||
|
||||
CreateImportCommands();
|
||||
ImportGui::Workbench::init();
|
||||
|
||||
PyMOD_Return(mod);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user