Skip to content

Commit ae1dbd0

Browse files
WIP
1 parent fb11b56 commit ae1dbd0

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/mobase/wrappers/basic_classes.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ namespace mo2::python {
201201
.def("library", &ExecutableForcedLoadSetting::library)
202202
.def("process", &ExecutableForcedLoadSetting::process);
203203

204-
py::class_<IExecutable, std::shared_ptr<IExecutable>>(m, "IExecutable")
204+
py::class_<IExecutable>(m, "IExecutable")
205205
.def("title", &IExecutable::title)
206206
.def("binaryInfo", &IExecutable::binaryInfo)
207207
.def("arguments", &IExecutable::arguments)
@@ -213,10 +213,13 @@ namespace mo2::python {
213213
.def("hide", &IExecutable::hide);
214214

215215
py::class_<IExecutablesList>(m, "IExecutablesList")
216-
.def("executables", &IExecutablesList::executables)
216+
.def("executables",
217+
[](IExecutablesList* executablesList) {
218+
return make_generator(executablesList->executables());
219+
})
217220
.def("getByTitle", &IExecutablesList::getByTitle, "title"_a)
218221
.def("getByBinary", &IExecutablesList::getByBinary, "info"_a)
219-
.def("titleExists", &IExecutablesList::titleExists, "title"_a);
222+
.def("titleExists", &IExecutablesList::contains, "title"_a);
220223
}
221224

222225
void add_modinterface_classes(py::module_ m)

src/pybind11-utils/include/pybind11_utils/generator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ namespace mo2::python {
3434
[](state& s) -> state& {
3535
return s;
3636
})
37-
.def("__next__", [](state& s) {
37+
.def("__next__", [](state& s) -> decltype(auto) {
3838
if (s.it != s.g.end()) {
39-
const auto v = *s.it;
39+
decltype(auto) v = *s.it;
4040
s.it++;
4141
return v;
4242
}

0 commit comments

Comments
 (0)