App: Apply clang format (part 1)
This commit is contained in:
@@ -46,9 +46,10 @@ void DocumentObserverPython::addObserver(const Py::Object& obj)
|
||||
|
||||
void DocumentObserverPython::removeObserver(const Py::Object& obj)
|
||||
{
|
||||
DocumentObserverPython* obs=nullptr;
|
||||
for (std::vector<DocumentObserverPython*>::iterator it =
|
||||
_instances.begin(); it != _instances.end(); ++it) {
|
||||
DocumentObserverPython* obs = nullptr;
|
||||
for (std::vector<DocumentObserverPython*>::iterator it = _instances.begin();
|
||||
it != _instances.end();
|
||||
++it) {
|
||||
if ((*it)->inst == obj) {
|
||||
obs = *it;
|
||||
_instances.erase(it);
|
||||
@@ -59,33 +60,34 @@ void DocumentObserverPython::removeObserver(const Py::Object& obj)
|
||||
delete obs;
|
||||
}
|
||||
|
||||
DocumentObserverPython::DocumentObserverPython(const Py::Object& obj) : inst(obj)
|
||||
DocumentObserverPython::DocumentObserverPython(const Py::Object& obj)
|
||||
: inst(obj)
|
||||
{
|
||||
#define FC_PY_ELEMENT_ARG0(_name1, _name2) do {\
|
||||
FC_PY_GetCallable(obj.ptr(), "slot" #_name1, py##_name1.py);\
|
||||
if (!py##_name1.py.isNone())\
|
||||
py##_name1.slot = App::GetApplication().signal##_name2.connect(\
|
||||
std::bind(&DocumentObserverPython::slot##_name1, this));\
|
||||
}\
|
||||
while(0);
|
||||
#define FC_PY_ELEMENT_ARG0(_name1, _name2) \
|
||||
do { \
|
||||
FC_PY_GetCallable(obj.ptr(), "slot" #_name1, py##_name1.py); \
|
||||
if (!py##_name1.py.isNone()) \
|
||||
py##_name1.slot = App::GetApplication().signal##_name2.connect( \
|
||||
std::bind(&DocumentObserverPython::slot##_name1, this)); \
|
||||
} while (0);
|
||||
|
||||
|
||||
#define FC_PY_ELEMENT_ARG1(_name1, _name2) do {\
|
||||
FC_PY_GetCallable(obj.ptr(), "slot" #_name1, py##_name1.py);\
|
||||
if (!py##_name1.py.isNone())\
|
||||
py##_name1.slot = App::GetApplication().signal##_name2.connect(\
|
||||
std::bind(&DocumentObserverPython::slot##_name1, this, sp::_1));\
|
||||
}\
|
||||
while(0);
|
||||
#define FC_PY_ELEMENT_ARG1(_name1, _name2) \
|
||||
do { \
|
||||
FC_PY_GetCallable(obj.ptr(), "slot" #_name1, py##_name1.py); \
|
||||
if (!py##_name1.py.isNone()) \
|
||||
py##_name1.slot = App::GetApplication().signal##_name2.connect( \
|
||||
std::bind(&DocumentObserverPython::slot##_name1, this, sp::_1)); \
|
||||
} while (0);
|
||||
|
||||
//NOLINTBEGIN
|
||||
#define FC_PY_ELEMENT_ARG2(_name1, _name2) do {\
|
||||
FC_PY_GetCallable(obj.ptr(), "slot" #_name1, py##_name1.py);\
|
||||
if (!py##_name1.py.isNone())\
|
||||
py##_name1.slot = App::GetApplication().signal##_name2.connect(\
|
||||
std::bind(&DocumentObserverPython::slot##_name1, this, sp::_1, sp::_2));\
|
||||
}\
|
||||
while(0);
|
||||
// NOLINTBEGIN
|
||||
#define FC_PY_ELEMENT_ARG2(_name1, _name2) \
|
||||
do { \
|
||||
FC_PY_GetCallable(obj.ptr(), "slot" #_name1, py##_name1.py); \
|
||||
if (!py##_name1.py.isNone()) \
|
||||
py##_name1.slot = App::GetApplication().signal##_name2.connect( \
|
||||
std::bind(&DocumentObserverPython::slot##_name1, this, sp::_1, sp::_2)); \
|
||||
} while (0);
|
||||
|
||||
FC_PY_ELEMENT_ARG1(CreatedDocument, NewDocument)
|
||||
FC_PY_ELEMENT_ARG1(DeletedDocument, DeleteDocument)
|
||||
@@ -116,7 +118,7 @@ DocumentObserverPython::DocumentObserverPython(const Py::Object& obj) : inst(obj
|
||||
FC_PY_ELEMENT_ARG2(ChangePropertyEditor, ChangePropertyEditor)
|
||||
FC_PY_ELEMENT_ARG2(BeforeAddingDynamicExtension, BeforeAddingDynamicExtension)
|
||||
FC_PY_ELEMENT_ARG2(AddedDynamicExtension, AddedDynamicExtension)
|
||||
//NOLINTEND
|
||||
// NOLINTEND
|
||||
}
|
||||
|
||||
DocumentObserverPython::~DocumentObserverPython() = default;
|
||||
@@ -127,10 +129,10 @@ void DocumentObserverPython::slotCreatedDocument(const App::Document& Doc)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyCreatedDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyCreatedDocument.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -141,10 +143,10 @@ void DocumentObserverPython::slotDeletedDocument(const App::Document& Doc)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyDeletedDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyDeletedDocument.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -155,10 +157,10 @@ void DocumentObserverPython::slotRelabelDocument(const App::Document& Doc)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyRelabelDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyRelabelDocument.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -169,10 +171,10 @@ void DocumentObserverPython::slotActivateDocument(const App::Document& Doc)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyActivateDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyActivateDocument.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -183,10 +185,10 @@ void DocumentObserverPython::slotUndoDocument(const App::Document& Doc)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyUndoDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyUndoDocument.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -198,10 +200,10 @@ void DocumentObserverPython::slotRedoDocument(const App::Document& Doc)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(Doc).getPyObject()));
|
||||
Base::pyCall(pyRedoDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyRedoDocument.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -213,7 +215,7 @@ void DocumentObserverPython::slotUndo()
|
||||
Base::pyCall(pyUndo.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -225,7 +227,7 @@ void DocumentObserverPython::slotRedo()
|
||||
Base::pyCall(pyRedo.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -236,10 +238,10 @@ void DocumentObserverPython::slotBeforeCloseTransaction(bool abort)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Boolean(abort));
|
||||
Base::pyCall(pyBeforeCloseTransaction.ptr(),args.ptr());
|
||||
Base::pyCall(pyBeforeCloseTransaction.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -250,15 +252,16 @@ void DocumentObserverPython::slotCloseTransaction(bool abort)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::Boolean(abort));
|
||||
Base::pyCall(pyCloseTransaction.ptr(),args.ptr());
|
||||
Base::pyCall(pyCloseTransaction.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentObserverPython::slotBeforeChangeDocument(const App::Document& Doc, const App::Property& Prop)
|
||||
void DocumentObserverPython::slotBeforeChangeDocument(const App::Document& Doc,
|
||||
const App::Property& Prop)
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
@@ -269,16 +272,17 @@ void DocumentObserverPython::slotBeforeChangeDocument(const App::Document& Doc,
|
||||
const char* prop_name = Doc.getPropertyName(&Prop);
|
||||
if (prop_name) {
|
||||
args.setItem(1, Py::String(prop_name));
|
||||
Base::pyCall(pyBeforeChangeDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyBeforeChangeDocument.ptr(), args.ptr());
|
||||
}
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentObserverPython::slotChangedDocument(const App::Document& Doc, const App::Property& Prop)
|
||||
void DocumentObserverPython::slotChangedDocument(const App::Document& Doc,
|
||||
const App::Property& Prop)
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
@@ -289,11 +293,11 @@ void DocumentObserverPython::slotChangedDocument(const App::Document& Doc, const
|
||||
const char* prop_name = Doc.getPropertyName(&Prop);
|
||||
if (prop_name) {
|
||||
args.setItem(1, Py::String(prop_name));
|
||||
Base::pyCall(pyChangedDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyChangedDocument.ptr(), args.ptr());
|
||||
}
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -304,10 +308,10 @@ void DocumentObserverPython::slotCreatedObject(const App::DocumentObject& Obj)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
|
||||
Base::pyCall(pyCreatedObject.ptr(),args.ptr());
|
||||
Base::pyCall(pyCreatedObject.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -318,16 +322,16 @@ void DocumentObserverPython::slotDeletedObject(const App::DocumentObject& Obj)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
|
||||
Base::pyCall(pyDeletedObject.ptr(),args.ptr());
|
||||
Base::pyCall(pyDeletedObject.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentObserverPython::slotBeforeChangeObject(const App::DocumentObject& Obj,
|
||||
const App::Property& Prop)
|
||||
const App::Property& Prop)
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
@@ -338,11 +342,11 @@ void DocumentObserverPython::slotBeforeChangeObject(const App::DocumentObject& O
|
||||
const char* prop_name = Obj.getPropertyName(&Prop);
|
||||
if (prop_name) {
|
||||
args.setItem(1, Py::String(prop_name));
|
||||
Base::pyCall(pyBeforeChangeObject.ptr(),args.ptr());
|
||||
Base::pyCall(pyBeforeChangeObject.ptr(), args.ptr());
|
||||
}
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -359,11 +363,11 @@ void DocumentObserverPython::slotChangedObject(const App::DocumentObject& Obj,
|
||||
const char* prop_name = Obj.getPropertyName(&Prop);
|
||||
if (prop_name) {
|
||||
args.setItem(1, Py::String(prop_name));
|
||||
Base::pyCall(pyChangedObject.ptr(),args.ptr());
|
||||
Base::pyCall(pyChangedObject.ptr(), args.ptr());
|
||||
}
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -374,10 +378,10 @@ void DocumentObserverPython::slotRecomputedObject(const App::DocumentObject& Obj
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::DocumentObject&>(Obj).getPyObject()));
|
||||
Base::pyCall(pyRecomputedObject.ptr(),args.ptr());
|
||||
Base::pyCall(pyRecomputedObject.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -388,10 +392,10 @@ void DocumentObserverPython::slotRecomputedDocument(const App::Document& doc)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
Base::pyCall(pyRecomputedDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyRecomputedDocument.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -402,10 +406,10 @@ void DocumentObserverPython::slotBeforeRecomputeDocument(const App::Document& do
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
Base::pyCall(pyBeforeRecomputeDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyBeforeRecomputeDocument.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -417,10 +421,10 @@ void DocumentObserverPython::slotOpenTransaction(const App::Document& doc, std::
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
args.setItem(1, Py::String(str));
|
||||
Base::pyCall(pyOpenTransaction.ptr(),args.ptr());
|
||||
Base::pyCall(pyOpenTransaction.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -431,10 +435,10 @@ void DocumentObserverPython::slotCommitTransaction(const App::Document& doc)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
Base::pyCall(pyCommitTransaction.ptr(),args.ptr());
|
||||
Base::pyCall(pyCommitTransaction.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -445,10 +449,10 @@ void DocumentObserverPython::slotAbortTransaction(const App::Document& doc)
|
||||
try {
|
||||
Py::Tuple args(1);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
Base::pyCall(pyAbortTransaction.ptr(),args.ptr());
|
||||
Base::pyCall(pyAbortTransaction.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -465,11 +469,11 @@ void DocumentObserverPython::slotAppendDynamicProperty(const App::Property& Prop
|
||||
const char* prop_name = container->getPropertyName(&Prop);
|
||||
if (prop_name) {
|
||||
args.setItem(1, Py::String(prop_name));
|
||||
Base::pyCall(pyAppendDynamicProperty.ptr(),args.ptr());
|
||||
Base::pyCall(pyAppendDynamicProperty.ptr(), args.ptr());
|
||||
}
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
@@ -486,16 +490,17 @@ void DocumentObserverPython::slotRemoveDynamicProperty(const App::Property& Prop
|
||||
const char* prop_name = container->getPropertyName(&Prop);
|
||||
if (prop_name) {
|
||||
args.setItem(1, Py::String(prop_name));
|
||||
Base::pyCall(pyRemoveDynamicProperty.ptr(),args.ptr());
|
||||
Base::pyCall(pyRemoveDynamicProperty.ptr(), args.ptr());
|
||||
}
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentObserverPython::slotChangePropertyEditor(const App::Document &, const App::Property& Prop)
|
||||
void DocumentObserverPython::slotChangePropertyEditor(const App::Document&,
|
||||
const App::Property& Prop)
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
@@ -507,72 +512,76 @@ void DocumentObserverPython::slotChangePropertyEditor(const App::Document &, con
|
||||
const char* prop_name = container->getPropertyName(&Prop);
|
||||
if (prop_name) {
|
||||
args.setItem(1, Py::String(prop_name));
|
||||
Base::pyCall(pyChangePropertyEditor.ptr(),args.ptr());
|
||||
Base::pyCall(pyChangePropertyEditor.ptr(), args.ptr());
|
||||
}
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentObserverPython::slotStartSaveDocument(const App::Document& doc, const std::string& file)
|
||||
void DocumentObserverPython::slotStartSaveDocument(const App::Document& doc,
|
||||
const std::string& file)
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
args.setItem(1, Py::String(file));
|
||||
Base::pyCall(pyStartSaveDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyStartSaveDocument.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentObserverPython::slotFinishSaveDocument(const App::Document& doc, const std::string& file)
|
||||
void DocumentObserverPython::slotFinishSaveDocument(const App::Document& doc,
|
||||
const std::string& file)
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::asObject(const_cast<App::Document&>(doc).getPyObject()));
|
||||
args.setItem(1, Py::String(file));
|
||||
Base::pyCall(pyFinishSaveDocument.ptr(),args.ptr());
|
||||
Base::pyCall(pyFinishSaveDocument.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentObserverPython::slotBeforeAddingDynamicExtension(const App::ExtensionContainer& extcont, std::string extension)
|
||||
void DocumentObserverPython::slotBeforeAddingDynamicExtension(
|
||||
const App::ExtensionContainer& extcont,
|
||||
std::string extension)
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::asObject(const_cast<App::ExtensionContainer&>(extcont).getPyObject()));
|
||||
args.setItem(1, Py::String(extension));
|
||||
Base::pyCall(pyBeforeAddingDynamicExtension.ptr(),args.ptr());
|
||||
Base::pyCall(pyBeforeAddingDynamicExtension.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentObserverPython::slotAddedDynamicExtension(const App::ExtensionContainer& extcont, std::string extension)
|
||||
void DocumentObserverPython::slotAddedDynamicExtension(const App::ExtensionContainer& extcont,
|
||||
std::string extension)
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
try {
|
||||
Py::Tuple args(2);
|
||||
args.setItem(0, Py::asObject(const_cast<App::ExtensionContainer&>(extcont).getPyObject()));
|
||||
args.setItem(1, Py::String(extension));
|
||||
Base::pyCall(pyAddedDynamicExtension.ptr(),args.ptr());
|
||||
Base::pyCall(pyAddedDynamicExtension.ptr(), args.ptr());
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
Base::PyException e; // extract the Python error text
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user