@@ -49,7 +49,7 @@ namespace mo2::detail {
4949 return std::make_shared<PyFileTree>(parent, name, m_Callback);
5050 }
5151
52- bool doPopulate (std::shared_ptr<const IFileTree> parent,
52+ bool doPopulate ([[maybe_unused]] std::shared_ptr<const IFileTree> parent,
5353 std::vector<std::shared_ptr<FileTreeEntry>>&) const override
5454 {
5555 return true ;
@@ -83,10 +83,6 @@ namespace mo2::python {
8383
8484 void add_ifiletree_bindings (pybind11::module_& m)
8585 {
86-
87- // register generator for walk and glob
88- register_generator_type<std::shared_ptr<const FileTreeEntry>>(m);
89-
9086 // FileTreeEntry class:
9187 auto fileTreeEntryClass =
9288 py::class_<FileTreeEntry, std::shared_ptr<FileTreeEntry>>(m,
@@ -191,10 +187,17 @@ namespace mo2::python {
191187 QString>(&IFileTree::walk, py::const_),
192188 py::arg (" callback" ), py::arg (" sep" ) = " \\ " );
193189
194- iFileTreeClass.def (" walk" , py::overload_cast<>(&IFileTree::walk, py::const_));
190+ iFileTreeClass.def (" walk" , [](IFileTree const * tree) {
191+ return make_generator (tree->walk ());
192+ });
195193
196- iFileTreeClass.def (" glob" , &IFileTree::glob, py::arg (" pattern" ),
197- py::arg (" type" ) = IFileTree::GlobPatternType::GLOB );
194+ iFileTreeClass.def (
195+ " glob" , // &IFileTree::glob,
196+ [](IFileTree const * tree, QString pattern,
197+ IFileTree::GlobPatternType patternType) {
198+ return make_generator (tree->glob (pattern, patternType));
199+ },
200+ py::arg (" pattern" ), py::arg (" type" ) = IFileTree::GlobPatternType::GLOB );
198201
199202 // Kind-of-static operations:
200203 iFileTreeClass.def (" createOrphanTree" , &IFileTree::createOrphanTree,
0 commit comments