+ simplify porting of Import module to Python3
This commit is contained in:
@@ -32,17 +32,13 @@
|
||||
#include "StepShapePy.h"
|
||||
#include "StepShape.h"
|
||||
|
||||
namespace Import {
|
||||
extern PyObject* initModule();
|
||||
}
|
||||
|
||||
/* registration table */
|
||||
extern struct PyMethodDef Import_Import_methods[];
|
||||
|
||||
PyDoc_STRVAR(module_doc,
|
||||
"This module is about import/export files formates.\n"
|
||||
"\n");
|
||||
extern "C" {
|
||||
void ImportExport initImport()
|
||||
PyMODINIT_FUNC initImport()
|
||||
{
|
||||
PyObject* importModule = Py_InitModule3("Import", Import_Import_methods, module_doc); /* mod name, table ptr */
|
||||
PyObject* importModule = Import::initModule();
|
||||
|
||||
try {
|
||||
Base::Interpreter().loadModule("Part");
|
||||
@@ -53,13 +49,10 @@ void ImportExport initImport()
|
||||
}
|
||||
|
||||
// add mesh elements
|
||||
Base::Interpreter().addType(&Import::StepShapePy ::Type,importModule,"StepShape");
|
||||
Base::Interpreter().addType(&Import::StepShapePy ::Type, importModule, "StepShape");
|
||||
|
||||
// init Type system
|
||||
//Import::StepShape ::init();
|
||||
|
||||
Base::Console().Log("Loading Import module... done\n");
|
||||
}
|
||||
|
||||
|
||||
} // extern "C" {
|
||||
|
||||
Reference in New Issue
Block a user