- ePyObject str = PyList_GET_ITEM(provider_list, size);
- if (!PyString_Check(str))
+ ePyObject tuple = PyList_GET_ITEM(provider_list, size);
+ if (!PyTuple_Check(tuple))
+ {
+ char buf[255];
+ snprintf(buf, 255, "eDVBCIInterfaces::setDescrambleRules entry in provider list is not a tuple it is '%s'!!", PyObject_TypeStr(tuple));
+ PyErr_SetString(PyExc_StandardError, buf);
+ return -1;
+ }
+ if (PyTuple_Size(tuple) != 2)
+ {
+ char buf[255];
+ snprintf(buf, 255, "eDVBCIInterfaces::setDescrambleRules provider tuple has %d instead of 2 entries!!", PyTuple_Size(tuple));
+ PyErr_SetString(PyExc_StandardError, buf);
+ return -1;
+ }
+ if (!PyString_Check(PyTuple_GET_ITEM(tuple, 0)))
+ {
+ char buf[255];
+ snprintf(buf, 255, "eDVBCIInterfaces::setDescrambleRules 1st entry in provider tuple is not a string it is '%s'", PyObject_TypeStr(PyTuple_GET_ITEM(tuple, 0)));
+ PyErr_SetString(PyExc_StandardError, buf);
+ return -1;
+ }
+ if (!PyLong_Check(PyTuple_GET_ITEM(tuple, 1)))