diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-06-21 15:31:57 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-06-21 15:31:57 +0000 |
| commit | da9872eac33f4f8a085261c3cbdcbf4c8d664f65 (patch) | |
| tree | 45fbd868e6554cf4b2c478f06d08eca550ef4902 /lib/python/python.cpp | |
| parent | 309ef1b36240139a265dd501c00d219ecd7428ca (diff) | |
| download | enigma2-da9872eac33f4f8a085261c3cbdcbf4c8d664f65.tar.gz enigma2-da9872eac33f4f8a085261c3cbdcbf4c8d664f65.zip | |
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
Diffstat (limited to 'lib/python/python.cpp')
| -rw-r--r-- | lib/python/python.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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; |
