| 768 | } |
| 769 | |
| 770 | void ExternalManager::migrateModel(const QString& libraryName, |
| 771 | const QString& path, |
| 772 | const Model& model) |
| 773 | { |
| 774 | connect(); |
| 775 | |
| 776 | Base::PyGILStateLocker lock; |
| 777 | try { |
| 778 | if (_managerObject.hasAttr("migrateModel")) { |
| 779 | Py::Callable libraries(_managerObject.getAttr("migrateModel")); |
| 780 | Py::Tuple args(3); |
| 781 | args.setItem(0, Py::String(libraryName.toStdString())); |
| 782 | args.setItem(1, Py::String(path.toStdString())); |
| 783 | args.setItem(2, Py::Object(new ModelPy(new Model(model)), true)); |
| 784 | libraries.apply(args); // No return expected |
| 785 | } |
| 786 | else { |
| 787 | Base::Console().log("\tmigrateModel() not found\n"); |
| 788 | throw ConnectionError(); |
| 789 | } |
| 790 | } |
| 791 | catch (Py::Exception& e) { |
| 792 | Base::PyException e1; // extract the Python error text |
| 793 | throw CreationError(e1.what()); |
| 794 | } |
| 795 | } |
| 796 | |
| 797 | void ExternalManager::updateModel(const QString& libraryName, |
| 798 | const QString& path, |
no test coverage detected