| 83 | } |
| 84 | |
| 85 | void PythonModule::registerModule() |
| 86 | { |
| 87 | rMessage() << "Registering darkradiant module to Python using pybind11 version " << |
| 88 | PYBIND11_VERSION_STR << std::endl; |
| 89 | |
| 90 | // Register the darkradiant module to Python, the InitModule function |
| 91 | // will be called as soon as the module is imported |
| 92 | int result = PyImport_AppendInittab(ModuleName, InitModule); |
| 93 | |
| 94 | if (result == -1) |
| 95 | { |
| 96 | rError() << "Could not initialise Python module" << std::endl; |
| 97 | return; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | ExecutionResultPtr PythonModule::executeString(const std::string& scriptString) |
| 102 | { |