+ 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)))
+ {
+ char buf[255];
+ snprintf(buf, 255, "eDVBCIInterfaces::setDescrambleRules 2nd entry in provider tuple is not a long it is '%s'", PyObject_TypeStr(PyTuple_GET_ITEM(tuple, 1)));
+ PyErr_SetString(PyExc_StandardError, buf);
+ return -1;
+ }
+ char *tmpstr = PyString_AS_STRING(PyTuple_GET_ITEM(tuple, 0));
+ uint32_t orbpos = PyLong_AsUnsignedLong(PyTuple_GET_ITEM(tuple, 1));