| 820 | } |
| 821 | |
| 822 | PyObject* InterpreterSingleton::getValue(const char* key, const char* result_var) |
| 823 | { |
| 824 | PyObject* module {}; |
| 825 | PyObject* dict {}; |
| 826 | PyObject* presult {}; |
| 827 | |
| 828 | PyGILStateLocker locker; |
| 829 | module = PP_Load_Module("__main__"); /* get module, init python */ |
| 830 | if (!module) { |
| 831 | throw PyException(); /* not incref'd */ |
| 832 | } |
| 833 | dict = PyModule_GetDict(module); /* get dict namespace */ |
| 834 | if (!dict) { |
| 835 | throw PyException(); /* not incref'd */ |
| 836 | } |
| 837 | |
| 838 | |
| 839 | presult = PyRun_String(key, Py_file_input, dict, dict); /* eval direct */ |
| 840 | if (!presult) { |
| 841 | throw PyException(); |
| 842 | } |
| 843 | Py_DECREF(presult); |
| 844 | |
| 845 | return PyObject_GetAttrString(module, result_var); |
| 846 | } |
| 847 | |
| 848 | void InterpreterSingleton::dbgObserveFile(const char* sFileName) |
| 849 | { |
nothing calls this directly
no test coverage detected