Mark attribute 'Type' deprecated, use 'TypeId' now

This commit is contained in:
wmayer 2013-05-03 21:23:34 +02:00
parent e18dcef6db
commit 9ad4bb5595
2 changed files with 14 additions and 1 deletions

View File

@ -26,10 +26,16 @@
</Methode>
<Attribute Name="Type" ReadOnly="true">
<Documentation>
<UserDocu>Is the type of the FreeCAD object with module domain</UserDocu>
<UserDocu>Is the type of the FreeCAD object with module domain (deprecated use TypeId)</UserDocu>
</Documentation>
<Parameter Name="Type" Type="String" />
</Attribute>
<Attribute Name="TypeId" ReadOnly="true">
<Documentation>
<UserDocu>Is the type of the FreeCAD object with module domain</UserDocu>
</Documentation>
<Parameter Name="TypeId" Type="String" />
</Attribute>
<Attribute Name="Module" ReadOnly="true">
<Documentation>
<UserDocu>Module in which this class is defined</UserDocu>

View File

@ -69,6 +69,13 @@ PyObject* BaseClassPy::getAllDerivedFrom(PyObject *args)
}
Py::String BaseClassPy::getType(void) const
{
PyErr_SetString(PyExc_DeprecationWarning, "Use 'TypeId' instead");
PyErr_Print();
return Py::String(std::string(getBaseClassPtr()->getTypeId().getName()));
}
Py::String BaseClassPy::getTypeId(void) const
{
return Py::String(std::string(getBaseClassPtr()->getTypeId().getName()));
}