+ support of merging projects on App level

This commit is contained in:
wmayer
2014-12-07 00:38:53 +01:00
parent a9bf0c88ae
commit cd139eca5f
8 changed files with 266 additions and 52 deletions

View File

@@ -31,6 +31,7 @@
#include <Base/FileInfo.h>
#include "DocumentObject.h"
#include "DocumentObjectPy.h"
#include "MergeDocuments.h"
// inclusion of the generated files (generated By DocumentPy.xml)
#include "DocumentPy.h"
@@ -135,6 +136,22 @@ PyObject* DocumentPy::restore(PyObject * args)
Py_Return;
}
PyObject* DocumentPy::mergeProject(PyObject * args)
{
char* filename;
if (!PyArg_ParseTuple(args, "s", &filename)) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
Base::FileInfo fi(filename);
Base::ifstream str(fi, std::ios::in | std::ios::binary);
App::Document* doc = getDocumentPtr();
MergeDocuments md(doc);
md.importObjects(str);
Py_Return;
} PY_CATCH;
}
PyObject* DocumentPy::exportGraphviz(PyObject * args)
{
char* fn=0;