| 73 | } |
| 74 | |
| 75 | void PythonEngine::setupPythonPath(const std::vector<openstudio::path>& includeDirs) { |
| 76 | |
| 77 | // Iterate in reverse order since addToPythonPath always inserts at pos 0 |
| 78 | // --python_path path1 --python_path path2 => includeDirs = ["path1", "path2"] |
| 79 | // std::ranges::reverse_view needs modern compilers |
| 80 | for (auto it = includeDirs.rbegin(); it != includeDirs.rend(); it++) { |
| 81 | addToPythonPath(*it); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | PythonEngine::PythonEngine(int argc, char* argv[]) : ScriptEngine(argc, argv), program(Py_DecodeLocale(pythonProgramName, nullptr)) { |
| 86 | // TODO: modernize and use PyConfig (new in 3.8): https://docs.python.org/3/c-api/init_config.html |
no test coverage detected