From da9872eac33f4f8a085261c3cbdcbf4c8d664f65 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Sat, 21 Jun 2008 15:31:57 +0000 Subject: use another function to initial import mytest.py (this fixes python threads)... but take care of the fact that the most enigma2 code is not thread safe.. so dont call enigma2 parts from another python thread --- lib/python/python.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/python/python.cpp') diff --git a/lib/python/python.cpp b/lib/python/python.cpp index ad029fb6..b7a4cf38 100644 --- a/lib/python/python.cpp +++ b/lib/python/python.cpp @@ -133,6 +133,16 @@ 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; -- cgit v1.2.3