+ simplify porting of Points module to Python3

This commit is contained in:
wmayer
2016-01-20 00:00:41 +01:00
parent 21504fc467
commit bb9bdb9548
3 changed files with 223 additions and 194 deletions

View File

@@ -35,22 +35,18 @@
#include "PropertyPointKernel.h"
#include "ViewFeature.h"
/* registration table */
extern struct PyMethodDef Points_Import_methods[];
namespace Points {
extern PyObject* initModule();
}
/* Python entry */
extern "C" {
void PointsExport initPoints()
PyMODINIT_FUNC initPoints()
{
PyObject* pointsModule = Py_InitModule("Points", Points_Import_methods); /* mod name, table ptr */
PyObject* pointsModule = Points::initModule();
Base::Console().Log("Loading Points module... done\n");
// add python types
Base::Interpreter().addType(&Points::PointsPy ::Type,pointsModule,"Points");
Base::Interpreter().addType(&Points::PointsPy::Type, pointsModule, "Points");
// add properties
Points::PropertyGreyValue ::init();
@@ -65,5 +61,3 @@ void PointsExport initPoints()
Points::FeaturePython ::init();
Points::ViewFeature ::init();
}
} // extern "C"