+ Make Python API more pythonic

This commit is contained in:
wmayer
2013-10-11 13:57:05 +02:00
parent 890d454eca
commit 4686118f2a
20 changed files with 255 additions and 256 deletions

View File

@@ -273,13 +273,13 @@ PyObject* BezierCurvePy::getPoles(PyObject * args)
PyObject* BezierCurvePy::setPoles(PyObject * args)
{
PyObject* plist;
if (!PyArg_ParseTuple(args, "O!", &(PyList_Type), &plist))
if (!PyArg_ParseTuple(args, "O", &plist))
return 0;
try {
Py::List list(plist);
Py::Sequence list(plist);
TColgp_Array1OfPnt poles(1,list.size());
int index = poles.Lower();
for (Py::List::iterator it = list.begin(); it != list.end(); ++it) {
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
Py::Vector v(*it);
Base::Vector3d pole = v.toVector();
poles.SetValue(index++, gp_Pnt(pole.x,pole.y,pole.z));