Merge pull request #522 from looooo/python3-import+inspect
Python3 import+inspect
This commit is contained in:
commit
99fa203f32
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <CXX/Objects.hxx>
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/PyObjectBase.h>
|
||||
#include "InspectionFeature.h"
|
||||
|
||||
|
||||
|
@ -56,15 +57,16 @@ PyObject* initModule()
|
|||
|
||||
|
||||
/* Python entry */
|
||||
PyMODINIT_FUNC initInspection() {
|
||||
|
||||
PyMOD_INIT_FUNC(Inspection)
|
||||
{
|
||||
// ADD YOUR CODE HERE
|
||||
//
|
||||
//
|
||||
(void)Inspection::initModule();
|
||||
PyObject* mod = Inspection::initModule();
|
||||
Base::Console().Log("Loading Inspection module... done\n");
|
||||
|
||||
Inspection::PropertyDistanceList ::init();
|
||||
Inspection::Feature ::init();
|
||||
Inspection::Group ::init();
|
||||
PyMOD_Return(mod);
|
||||
}
|
||||
|
|
|
@ -62,11 +62,11 @@ PyObject* initModule()
|
|||
|
||||
|
||||
/* Python entry */
|
||||
PyMODINIT_FUNC initInspectionGui()
|
||||
PyMOD_INIT_FUNC(InspectionGui)
|
||||
{
|
||||
if (!Gui::Application::Instance) {
|
||||
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
|
||||
return;
|
||||
PyMOD_Return(0);
|
||||
}
|
||||
|
||||
// instanciating the commands
|
||||
|
@ -79,6 +79,7 @@ PyMODINIT_FUNC initInspectionGui()
|
|||
//
|
||||
//
|
||||
|
||||
(void)InspectionGui::initModule();
|
||||
PyObject* mod = InspectionGui::initModule();
|
||||
Base::Console().Log("Loading GUI of Inspection module... done\n");
|
||||
PyMOD_Return(mod);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user