| 224 | } |
| 225 | |
| 226 | bool containsLichtfeldModule(const std::filesystem::path& dir) { |
| 227 | std::error_code ec; |
| 228 | if (!std::filesystem::exists(dir, ec)) { |
| 229 | return false; |
| 230 | } |
| 231 | |
| 232 | for (std::filesystem::directory_iterator it(dir, ec), end; !ec && it != end; it.increment(ec)) { |
| 233 | std::error_code file_ec; |
| 234 | if (!it->is_regular_file(file_ec) || file_ec) { |
| 235 | continue; |
| 236 | } |
| 237 | |
| 238 | const auto filename = it->path().filename().string(); |
| 239 | const auto ext = it->path().extension().string(); |
| 240 | if ((ext == ".so" || ext == ".pyd") && filename.rfind("lichtfeld", 0) == 0) { |
| 241 | return true; |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | return false; |
| 246 | } |
| 247 | |
| 248 | std::filesystem::path findPythonModuleDir() { |
| 249 | std::error_code ec; |
no test coverage detected