MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / eval

Method eval

extensions/script/python/PythonScriptEngine.cpp:43–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void PythonScriptEngine::eval(const std::string &script) {
44 py::gil_scoped_acquire gil { };
45 try {
46 if (script[0] == '\n') {
47 py::eval<py::eval_statements>(py::module::import("textwrap").attr("dedent")(script), *bindings_, *bindings_);
48 } else {
49 py::eval<py::eval_statements>(script, *bindings_, *bindings_);
50 }
51 } catch (std::exception& e) {
52 throw minifi::script::ScriptException(e.what());
53 }
54}
55
56void PythonScriptEngine::evalFile(const std::string &file_name) {
57 py::gil_scoped_acquire gil { };

Callers 2

initializeMethod · 0.45
onScheduleMethod · 0.45

Calls 2

ScriptExceptionClass · 0.85
whatMethod · 0.45

Tested by

no test coverage detected