3
#include <libglom/init.h>
6
#include "glom/python_embed/glom_python.h"
9
extern "C" void __libc_freeres(void);
14
bool glom_python_module_is_available()
16
const gchar* name = "glom_" GLOM_ABI_VERSION_UNDERLINED;
17
PyObject* module_glom = PyImport_ImportModule((char*)name); //TODO: unref this?
21
g_warning("Glom: A python import of %s failed.\n", name);
24
return module_glom != 0;
27
bool gda_python_module_is_available()
29
const gchar* name = "gda";
30
PyObject* module_glom = PyImport_ImportModule((char*)name); //TODO: unref this?
34
g_warning("Glom: A python import of %s failed.\n", name);
37
return module_glom != 0;
45
atexit(__libc_freeres);
47
Glom::libglom_init(); // Calls PyInitialize()
49
if (!Glom::gda_python_module_is_available())
51
if (!Glom::glom_python_module_is_available())
54
Glom::libglom_deinit(); // Calls Py_Finalize();