+ simplify porting of Import module to Python3

This commit is contained in:
wmayer
2016-01-21 12:08:29 +01:00
parent 44ad4d94c7
commit a5b6e5d48a
4 changed files with 563 additions and 440 deletions

View File

@@ -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" {