py3: ported MeshPart to python3
This commit is contained in:
parent
3803896ff2
commit
2673f9ed59
|
@ -27,6 +27,7 @@
|
|||
#endif
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/PyObjectBase.h>
|
||||
#include <Base/Interpreter.h>
|
||||
|
||||
|
||||
|
@ -35,7 +36,7 @@ extern PyObject* initModule();
|
|||
}
|
||||
|
||||
/* Python entry */
|
||||
PyMODINIT_FUNC initMeshPart()
|
||||
PyMOD_INIT_FUNC(MeshPart)
|
||||
{
|
||||
// load dependent module
|
||||
try {
|
||||
|
@ -44,8 +45,9 @@ PyMODINIT_FUNC initMeshPart()
|
|||
}
|
||||
catch(const Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_ImportError, e.what());
|
||||
return;
|
||||
PyMOD_Return(0);
|
||||
}
|
||||
(void)MeshPart::initModule();
|
||||
PyObject* mod = MeshPart::initModule();
|
||||
Base::Console().Log("Loading MeshPart module... done\n");
|
||||
PyMOD_Return(mod);
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ private:
|
|||
std::vector<unsigned long> segm;
|
||||
segm.reserve(list.size());
|
||||
for (unsigned int i=0; i<list.size(); i++) {
|
||||
segm.push_back((int)Py::Int(list[i]));
|
||||
segm.push_back((int)Py::Long(list[i]));
|
||||
}
|
||||
|
||||
std::list<std::vector<Base::Vector3f> > bounds;
|
||||
|
|
|
@ -67,14 +67,14 @@ PyObject* initModule()
|
|||
|
||||
|
||||
/* Python entry */
|
||||
PyMODINIT_FUNC initMeshPartGui()
|
||||
PyMOD_INIT_FUNC(MeshPartGui)
|
||||
{
|
||||
if (!Gui::Application::Instance) {
|
||||
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
|
||||
return;
|
||||
PyMOD_Return(0);
|
||||
}
|
||||
|
||||
(void)MeshPartGui::initModule();
|
||||
PyObject* mod = MeshPartGui::initModule();
|
||||
Base::Console().Log("Loading GUI of MeshPart module... done\n");
|
||||
|
||||
// instantiating the commands
|
||||
|
@ -83,4 +83,6 @@ PyMODINIT_FUNC initMeshPartGui()
|
|||
|
||||
// add resources and reloads the translators
|
||||
loadMeshPartResource();
|
||||
|
||||
PyMOD_Return(mod);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user