+ simplify porting of Drawing module to Python3

This commit is contained in:
wmayer
2016-01-21 14:49:57 +01:00
parent bf10bf33f6
commit aa7aa64724
4 changed files with 222 additions and 177 deletions

View File

@@ -27,15 +27,13 @@
#include "FeatureClip.h"
#include "PageGroup.h"
extern struct PyMethodDef Drawing_methods[];
PyDoc_STRVAR(module_drawing_doc,
"This module is the drawing module.");
namespace Drawing {
extern PyObject* initModule();
}
/* Python entry */
extern "C" {
void DrawingExport initDrawing()
PyMODINIT_FUNC initDrawing()
{
// load dependent module
try {
@@ -46,7 +44,7 @@ void DrawingExport initDrawing()
PyErr_SetString(PyExc_ImportError, e.what());
return;
}
Py_InitModule3("Drawing", Drawing_methods, module_drawing_doc); /* mod name, table ptr */
(void)Drawing::initModule();
Base::Console().Log("Loading Drawing module... done\n");
@@ -66,5 +64,3 @@ void DrawingExport initDrawing()
Drawing::FeatureClip ::init();
Drawing::FeatureViewSpreadsheet ::init();
}
} // extern "C"