9#include <boost/python.hpp>
11#include <framework/utilities/RegisterPythonModule.h>
12#include <framework/logging/Logger.h>
20 if (PyImport_AppendInittab(
const_cast<char*
>(name), initFunc) == -1) {
21 B2FATAL(
"REGISTER_PYTHON_MODULE(" << name <<
") failed.");
25 if (!Py_IsInitialized()) {
26 B2FATAL(
"REGISTER_PYTHON_MODULE_AUTOIMPORT(" << name <<
"): Python is not initialized!");
29 std::string importString =
"import ";
31 if (PyRun_SimpleString(importString.c_str()) == -1) {
32 B2FATAL(
"'import " << name <<
"' failed.");
BoostPythonModuleProxy(const char *name, PyObject *(*initFunc)(), bool auto_import=false)
Don't construct this object yourself, use the REGISTER_PYTHON_MODULE macro instead.
Abstract base class for different kinds of events.