All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
ef997f2259
commit
9fe130cd73
@@ -36,35 +36,41 @@ std::string AttachExtensionPy::representation() const
|
||||
return {"<Part::AttachableObject>"};
|
||||
}
|
||||
|
||||
PyObject* AttachExtensionPy::positionBySupport(PyObject *args)
|
||||
PyObject* AttachExtensionPy::positionBySupport(PyObject* args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
if (!PyArg_ParseTuple(args, "")) {
|
||||
return nullptr;
|
||||
}
|
||||
bool bAttached = false;
|
||||
try{
|
||||
try {
|
||||
bAttached = this->getAttachExtensionPtr()->positionBySupport();
|
||||
} catch (Standard_Failure& e) {
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return nullptr;
|
||||
} catch (Base::Exception &e) {
|
||||
}
|
||||
catch (Base::Exception& e) {
|
||||
e.setPyException();
|
||||
return nullptr;
|
||||
}
|
||||
return Py::new_reference_to(Py::Boolean(bAttached));
|
||||
}
|
||||
|
||||
PyObject* AttachExtensionPy::changeAttacherType(PyObject *args)
|
||||
PyObject* AttachExtensionPy::changeAttacherType(PyObject* args)
|
||||
{
|
||||
const char* typeName;
|
||||
if (!PyArg_ParseTuple(args, "s", &typeName))
|
||||
if (!PyArg_ParseTuple(args, "s", &typeName)) {
|
||||
return nullptr;
|
||||
}
|
||||
bool ret;
|
||||
try{
|
||||
try {
|
||||
ret = this->getAttachExtensionPtr()->changeAttacherType(typeName);
|
||||
} catch (Standard_Failure& e) {
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return nullptr;
|
||||
} catch (Base::Exception &e) {
|
||||
}
|
||||
catch (Base::Exception& e) {
|
||||
e.setPyException();
|
||||
return nullptr;
|
||||
}
|
||||
@@ -74,23 +80,28 @@ PyObject* AttachExtensionPy::changeAttacherType(PyObject *args)
|
||||
Py::Object AttachExtensionPy::getAttacher() const
|
||||
{
|
||||
try {
|
||||
this->getAttachExtensionPtr()->attacher(); //throws if attacher is not set
|
||||
} catch (Base::Exception&) {
|
||||
this->getAttachExtensionPtr()->attacher(); // throws if attacher is not set
|
||||
}
|
||||
catch (Base::Exception&) {
|
||||
return Py::None();
|
||||
}
|
||||
|
||||
try {
|
||||
return Py::Object( new Attacher::AttachEnginePy(this->getAttachExtensionPtr()->attacher().copy()), true);
|
||||
} catch (Standard_Failure& e) {
|
||||
return Py::Object(
|
||||
new Attacher::AttachEnginePy(this->getAttachExtensionPtr()->attacher().copy()),
|
||||
true
|
||||
);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
throw Py::Exception(Part::PartExceptionOCCError, e.GetMessageString());
|
||||
} catch (Base::Exception &e) {
|
||||
}
|
||||
catch (Base::Exception& e) {
|
||||
e.setPyException();
|
||||
throw Py::Exception();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PyObject *AttachExtensionPy::getCustomAttributes(const char* /*attr*/) const
|
||||
PyObject* AttachExtensionPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
@@ -99,5 +110,3 @@ int AttachExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user