+ ret = onid.get() < 0xFF00;
+ break;
+ }
+ if (ret && m_additional_tsid_onid_check_func)
+ {
+ bool failed = true;
+ ePyObject dict = PyDict_New();
+ extern void PutToDict(ePyObject &, const char *, long);
+ PyDict_SetItemString(dict, "__builtins__", PyEval_GetBuiltins());
+ PutToDict(dict, "orbpos", orbital_position);
+ PutToDict(dict, "tsid", tsid.get());
+ PutToDict(dict, "onid", onid.get());
+ ePyObject r = PyEval_EvalCode((PyCodeObject*)(PyObject*)m_additional_tsid_onid_check_func, dict, dict);
+ if (r)
+ {
+ ePyObject o = PyDict_GetItemString(dict, "ret");
+ if (o)
+ {
+ if (PyInt_Check(o))
+ {
+ ret = PyInt_AsLong(o);
+ failed = false;
+ }
+ }
+ Py_DECREF(r);
+ }
+ if (failed && m_show_add_tsid_onid_check_failed_msg)
+ {
+ eDebug("execing /etc/enigma2/scan_tp_valid_check failed!\n"
+ "usable global variables in scan_tp_valid_check.py are 'orbpos', 'tsid', 'onid'\n"
+ "the return value must be stored in a global var named 'ret'");
+ m_show_add_tsid_onid_check_failed_msg=false;
+ }
+ Py_DECREF(dict);