mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
updated python api
This commit is contained in:
@@ -71,7 +71,7 @@ struct ModRepositoryFileInfo_to_python_dict
|
||||
PyDict_SetItemString(res, "description", bpy::incref(bpy::object(info.description.toUtf8().constData()).ptr()));
|
||||
PyDict_SetItemString(res, "categoryID", PyLong_FromLong(info.categoryID));
|
||||
PyDict_SetItemString(res, "fileID", PyLong_FromLong(info.fileID));
|
||||
PyDict_SetItemString(res, "fileSize", PyLong_FromLong(info.fileSize));
|
||||
PyDict_SetItemString(res, "fileSize", PyLong_FromLong(static_cast<long>(info.fileSize)));
|
||||
PyDict_SetItemString(res, "version", bpy::incref(bpy::object(info.version).ptr()));
|
||||
return bpy::incref(res);
|
||||
}
|
||||
@@ -731,6 +731,13 @@ BOOST_PYTHON_MODULE(mobase)
|
||||
.def("onFinishedRun", bpy::pure_virtual(&IOrganizer::onFinishedRun))
|
||||
.def("onModInstalled", bpy::pure_virtual(&IOrganizer::onModInstalled))
|
||||
.def("refreshModList", bpy::pure_virtual(&IOrganizer::refreshModList))
|
||||
.def("profile", bpy::pure_virtual(&IOrganizer::profile), bpy::return_value_policy<bpy::return_by_value>())
|
||||
;
|
||||
|
||||
bpy::class_<IProfileWrapper, boost::noncopyable>("IProfile")
|
||||
.def("name", bpy::pure_virtual(&IProfile::name))
|
||||
.def("absolutePath", bpy::pure_virtual(&IProfile::absolutePath))
|
||||
.def("localSavesEnabled", bpy::pure_virtual(&IProfile::localSavesEnabled))
|
||||
;
|
||||
|
||||
bpy::class_<ModRepositoryBridgeWrapper, boost::noncopyable>("ModRepositoryBridge")
|
||||
|
||||
@@ -232,6 +232,14 @@ struct IOrganizerWrapper: MOBase::IOrganizer, boost::python::wrapper<MOBase::IOr
|
||||
virtual bool onAboutToRun(const std::function<bool(const QString&)> &func) { return this->get_override("onAboutToRun")(func); }
|
||||
virtual bool onFinishedRun(const std::function<void(const QString&, unsigned int)> &func) { return this->get_override("onFinishedRun")(func); }
|
||||
virtual bool onModInstalled(const std::function<void(const QString&)> &func) { return this->get_override("onModInstalled")(func); }
|
||||
virtual MOBase::IProfile *profile() override { return this->get_override("profile")(); }
|
||||
};
|
||||
|
||||
struct IProfileWrapper: MOBase::IProfile, boost::python::wrapper<MOBase::IProfile>
|
||||
{
|
||||
virtual QString name() const { return this->get_override("name")(); }
|
||||
virtual QString absolutePath() const { return this->get_override("absolutePath")(); }
|
||||
virtual bool localSavesEnabled() const { return this->get_override("localSavesEnabled")(); }
|
||||
};
|
||||
|
||||
struct IDownloadManagerWrapper: MOBase::IDownloadManager, boost::python::wrapper<MOBase::IDownloadManager>
|
||||
|
||||
Reference in New Issue
Block a user