diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-09-02 01:30:26 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-09-02 01:30:26 +0000 |
| commit | cf3e9383de633c9305a950ba5896376b14e43e12 (patch) | |
| tree | 6b4147e5fce8d754911301f3d53c1e33431e292f /lib/python/python.cpp | |
| parent | 0379aa0cb4aab6c748b483de790de3b896611a0c (diff) | |
| download | enigma2-cf3e9383de633c9305a950ba5896376b14e43e12.tar.gz enigma2-cf3e9383de633c9305a950ba5896376b14e43e12.zip | |
- add ePython::call return support (only int)
Diffstat (limited to 'lib/python/python.cpp')
| -rw-r--r-- | lib/python/python.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/python/python.cpp b/lib/python/python.cpp index 14e32af6..a1ef1508 100644 --- a/lib/python/python.cpp +++ b/lib/python/python.cpp @@ -95,21 +95,23 @@ int ePython::execute(const std::string &pythonfile, const std::string &funcname) return 0; } -void ePython::call(PyObject *pFunc, PyObject *pArgs) +int ePython::call(PyObject *pFunc, PyObject *pArgs) { + int res = -1; PyObject *pValue; if (pFunc && PyCallable_Check(pFunc)) { pValue = PyObject_CallObject(pFunc, pArgs); if (pValue != NULL) { -// printf("Result of call: %ld\n", PyInt_AsLong(pValue)); + res = PyInt_AsLong(pValue); Py_DECREF(pValue); } else { PyErr_Print(); } } + return res; } PyObject *ePython::resolve(const std::string &pythonfile, const std::string &funcname) |
