diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index fb3de1211..f0f6d9abc 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -349,8 +349,8 @@ PyObject* Application::sExport(PyObject * /*self*/, PyObject *args,PyObject * /* PY_TRY { App::Document* doc = 0; - Py::List list(object); - for (Py::List::iterator it = list.begin(); it != list.end(); ++it) { + Py::Sequence list(object); + for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { PyObject* item = (*it).ptr(); if (PyObject_TypeCheck(item, &(App::DocumentObjectPy::Type))) { App::DocumentObject* obj = static_cast(item)->getDocumentObjectPtr(); diff --git a/src/Gui/TaskView/TaskDialogPython.cpp b/src/Gui/TaskView/TaskDialogPython.cpp index 71c9e02ea..0ed4e96cf 100644 --- a/src/Gui/TaskView/TaskDialogPython.cpp +++ b/src/Gui/TaskView/TaskDialogPython.cpp @@ -112,8 +112,8 @@ Py::Object ControlPy::closeDialog(const Py::Tuple&) Py::Object ControlPy::addTaskWatcher(const Py::Tuple& args) { std::vector watcher; - Py::List list(args[0]); - for (Py::List::iterator it = list.begin(); it != list.end(); ++it) { + Py::Sequence list(args[0]); + for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { TaskWatcherPython* w = new TaskWatcherPython(*it); watcher.push_back(w); } @@ -178,9 +178,9 @@ TaskWatcherPython::TaskWatcherPython(const Py::Object& o) Gui::TaskView::TaskBox *tb = 0; if (watcher.hasAttr(std::string("commands"))) { if (!tb) tb = new Gui::TaskView::TaskBox(icon, title, true, 0); - Py::List cmds(watcher.getAttr(std::string("commands"))); + Py::Sequence cmds(watcher.getAttr(std::string("commands"))); CommandManager &mgr = Gui::Application::Instance->commandManager(); - for (Py::List::iterator it = cmds.begin(); it != cmds.end(); ++it) { + for (Py::Sequence::iterator it = cmds.begin(); it != cmds.end(); ++it) { Py::String name(*it); std::string s = (std::string)name; Command *c = mgr.getCommandByName(s.c_str()); @@ -192,11 +192,11 @@ TaskWatcherPython::TaskWatcherPython(const Py::Object& o) if (watcher.hasAttr(std::string("widgets"))) { if (!tb && !title.isEmpty()) tb = new Gui::TaskView::TaskBox(icon, title, true, 0); - Py::List list(watcher.getAttr(std::string("widgets"))); + Py::Sequence list(watcher.getAttr(std::string("widgets"))); Gui::PythonWrapper wrap; if (wrap.loadCoreModule()) { - for (Py::List::iterator it = list.begin(); it != list.end(); ++it) { + for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { QObject* object = wrap.toQObject(*it); if (object) { QWidget* w = qobject_cast(object); diff --git a/src/Mod/Mesh/App/AppMeshPy.cpp b/src/Mod/Mesh/App/AppMeshPy.cpp index 587963f28..c4117b9aa 100644 --- a/src/Mod/Mesh/App/AppMeshPy.cpp +++ b/src/Mod/Mesh/App/AppMeshPy.cpp @@ -163,10 +163,10 @@ static PyObject * exporter(PyObject *self, PyObject *args) MeshObject global_mesh; PY_TRY { - Py::List list(object); + Py::Sequence list(object); Base::Type meshId = Base::Type::fromName("Mesh::Feature"); Base::Type partId = Base::Type::fromName("Part::Feature"); - for (Py::List::iterator it = list.begin(); it != list.end(); ++it) { + for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { PyObject* item = (*it).ptr(); if (PyObject_TypeCheck(item, &(App::DocumentObjectPy::Type))) { App::DocumentObject* obj = static_cast(item)->getDocumentObjectPtr(); @@ -382,25 +382,24 @@ createBox(PyObject *self, PyObject *args) static PyObject * calculateEigenTransform(PyObject *self, PyObject *args) -{ - PyObject *input; +{ + PyObject *input; - if (!PyArg_ParseTuple(args, "O",&input)) - return NULL; + if (!PyArg_ParseTuple(args, "O",&input)) + return NULL; if(! PySequence_Check(input) ){ PyErr_SetString(PyExc_Exception, "Input have to be a sequence of Base.Vector()"); return NULL; } - PY_TRY { - - MeshCore::MeshKernel aMesh; - MeshCore::MeshPointArray vertices; - vertices.clear(); - MeshCore::MeshFacetArray faces; - faces.clear(); - MeshCore::MeshPoint current_node; + PY_TRY { + MeshCore::MeshKernel aMesh; + MeshCore::MeshPointArray vertices; + vertices.clear(); + MeshCore::MeshFacetArray faces; + faces.clear(); + MeshCore::MeshPoint current_node; Py::Sequence list(input); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { diff --git a/src/Mod/Part/App/AppPartPy.cpp b/src/Mod/Part/App/AppPartPy.cpp index ffcf4ec16..e87f267eb 100644 --- a/src/Mod/Part/App/AppPartPy.cpp +++ b/src/Mod/Part/App/AppPartPy.cpp @@ -259,8 +259,8 @@ static PyObject * exporter(PyObject *self, PyObject *args) builder.MakeCompound(comp); PY_TRY { - Py::List list(object); - for (Py::List::iterator it = list.begin(); it != list.end(); ++it) { + Py::Sequence list(object); + for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { PyObject* item = (*it).ptr(); if (PyObject_TypeCheck(item, &(App::DocumentObjectPy::Type))) { App::DocumentObject* obj = static_cast(item)->getDocumentObjectPtr();