Part: geometry extensions minor code clean up

This commit is contained in:
Abdullah Tahiri
2019-02-14 06:33:06 +01:00
committed by wmayer
parent 42bc279941
commit 5a435f8d84
5 changed files with 22 additions and 23 deletions

View File

@@ -34,13 +34,13 @@ using namespace Part;
std::string GeometryIntExtensionPy::representation(void) const
{
std::stringstream str;
long id = getGeometryIntExtensionPtr()->getValue();
long val = getGeometryIntExtensionPtr()->getValue();
str << "<GeometryIntExtension (" ;
if(getGeometryIntExtensionPtr()->getName().size()>0)
str << "\'" << getGeometryIntExtensionPtr()->getName() << "\', ";
str << id << ") >";
str << val << ") >";
return str.str();
@@ -62,16 +62,16 @@ int GeometryIntExtensionPy::PyInit(PyObject* args, PyObject* /*kwd*/)
}
PyErr_Clear();
long Id;
if (PyArg_ParseTuple(args, "l", &Id)) {
this->getGeometryIntExtensionPtr()->setValue(Id);
long val;
if (PyArg_ParseTuple(args, "l", &val)) {
this->getGeometryIntExtensionPtr()->setValue(val);
return 0;
}
PyErr_Clear();
char * pystr;
if (PyArg_ParseTuple(args, "ls", &Id,&pystr)) {
this->getGeometryIntExtensionPtr()->setValue(Id);
if (PyArg_ParseTuple(args, "ls", &val,&pystr)) {
this->getGeometryIntExtensionPtr()->setValue(val);
this->getGeometryIntExtensionPtr()->setName(pystr);
return 0;
}