#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112L
extern "C" void init_enigma();
-extern void bsodFatal();
+extern "C" void eBaseInit(void);
+extern "C" void eConsoleInit(void);
+extern void bsodFatal(const char *component);
#define SKIP_PART2
#include <lib/python/python.h>
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
return 0;
}
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
if (m_erased || m_ob->ob_refcnt <= 0)
{
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
if (m_ob->ob_refcnt == 0x7FFFFFFF)
{
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
m_file = file;
m_line = line;
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
if (m_erased || m_ob->ob_refcnt <= 0)
{
if (m_file)
eDebug("last modified in file %s line %d from %d to %d",
m_file, m_line, m_from, m_to);
- bsodFatal();
+ bsodFatal("enigma2, refcnt");
}
m_file = file;
m_line = line;
PyEval_InitThreads();
init_enigma();
+ eBaseInit();
+ eConsoleInit();
}
ePython::~ePython()
Py_Finalize();
}
+int ePython::execFile(const char *file)
+{
+ FILE *fp = fopen(file, "r");
+ if (!fp)
+ return -ENOENT;
+ int ret = PyRun_SimpleFile(fp, file);
+ fclose(fp);
+ return ret;
+}
+
int ePython::execute(const std::string &pythonfile, const std::string &funcname)
{
ePyObject pName, pModule, pDict, pFunc, pArgs, pValue;
} else
{
PyErr_Print();
- bsodFatal();
+ ePyObject FuncStr = PyObject_Str(pFunc);
+ ePyObject ArgStr = PyObject_Str(pArgs);
+ eDebug("(PyObject_CallObject(%s,%s) failed)", PyString_AS_STRING(FuncStr), PyString_AS_STRING(ArgStr));
+ Py_DECREF(FuncStr);
+ Py_DECREF(ArgStr);
+ bsodFatal(0);
}
}
return res;