MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getValue

Method getValue

src/Base/Interpreter.cpp:822–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

820}
821
822PyObject* 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
848void InterpreterSingleton::dbgObserveFile(const char* sFileName)
849{

Callers

nothing calls this directly

Calls 2

PP_Load_ModuleFunction · 0.85
PyExceptionFunction · 0.85

Tested by

no test coverage detected