| 122 | }; |
| 123 | |
| 124 | static Scripting::RunResult runScript(std::string_view script, pybind11::dict& globals, bool captureOutput) |
| 125 | { |
| 126 | Scripting::RunResult result; |
| 127 | |
| 128 | if (captureOutput) |
| 129 | { |
| 130 | RedirectStream rstdout("stdout"); |
| 131 | RedirectStream rstderr("stderr"); |
| 132 | pybind11::exec(script, globals); |
| 133 | result.out = rstdout; |
| 134 | result.err = rstderr; |
| 135 | } |
| 136 | else |
| 137 | { |
| 138 | pybind11::exec(script, globals); |
| 139 | } |
| 140 | |
| 141 | return result; |
| 142 | } |
| 143 | |
| 144 | Scripting::RunResult Scripting::runScript(std::string_view script, Context& context, bool captureOutput) |
| 145 | { |
no outgoing calls