From 5eeb02403f6341bb5105fd16d3e6b08c5c46fc92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sat, 30 May 2020 14:58:50 +0200 Subject: [PATCH] Update bindings after uibase update. --- src/runner/pythonrunner.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index 27b53cc..319e90e 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -361,13 +361,13 @@ BOOST_PYTHON_MODULE(mobase) // addFile() and addDirectory throws exception instead of returning null pointer in order // to have better traces. - .def("addFile", +[](IFileTree* w, QString name) { - auto result = w->addFile(name); + .def("addFile", +[](IFileTree* w, QString name, bool replaceIfExists) { + auto result = w->addFile(name, replaceIfExists); if (result == nullptr) { throw std::logic_error("addFile failed"); } return result; - }) + }, bpy::arg("replace_if_exists") = false) .def("addDirectory", +[](IFileTree* w, QString name) { auto result = w->addDirectory(name); if (result == nullptr) { @@ -470,6 +470,7 @@ BOOST_PYTHON_MODULE(mobase) bpy::class_("IInstallationManager", bpy::no_init) .def("extractFile", &IInstallationManager::extractFile) .def("extractFiles", &IInstallationManager::extractFiles) + .def("createFile", &IInstallationManager::createFile) .def("installArchive", &IInstallationManager::installArchive) .def("setURL", &IInstallationManager::setURL) ; @@ -887,7 +888,7 @@ BOOST_PYTHON_MODULE(moprivate) FileTree(std::shared_ptr parent, QString name, callback_t callback) : FileTreeEntry(parent, name), IFileTree(), m_Callback(callback){ } - std::shared_ptr addFile(QString name) override { + std::shared_ptr addFile(QString name, bool) override { if (m_Callback && !m_Callback(name, false)) { throw UnsupportedOperationException("File rejected by callback."); }