+ simplify porting of PartDesign module to Python3

This commit is contained in:
wmayer
2016-01-20 17:00:43 +01:00
parent ebc6d37262
commit 91d6e24f1e
5 changed files with 111 additions and 113 deletions

View File

@@ -49,15 +49,12 @@
#include "FeatureMultiTransform.h"
#include "FeatureHole.h"
extern struct PyMethodDef PartDesign_methods[];
PyDoc_STRVAR(module_PartDesign_doc,
"This module is the PartDesign module.");
namespace PartDesign {
extern PyObject* initModule();
}
/* Python entry */
extern "C" {
void PartDesignExport init_PartDesign()
PyMODINIT_FUNC init_PartDesign()
{
// load dependent module
try {
@@ -68,7 +65,8 @@ void PartDesignExport init_PartDesign()
PyErr_SetString(PyExc_ImportError, e.what());
return;
}
Py_InitModule3("_PartDesign", PartDesign_methods, module_PartDesign_doc); /* mod name, table ptr */
(void)PartDesign::initModule();
Base::Console().Log("Loading PartDesign module... done\n");
@@ -97,5 +95,3 @@ void PartDesignExport init_PartDesign()
PartDesign::Chamfer ::init();
PartDesign::Draft ::init();
}
} // extern "C"