- std::set<uint16_t>::iterator it(prog.caids.begin());
- while(cnt--)
- PyList_SET_ITEM(ret, cnt, PyInt_FromLong(*it++));
+ std::set<program::capid_pair>::iterator it(prog.caids.begin());
+ if (pair)
+ {
+ while(cnt--)
+ {
+ ePyObject tuple = PyTuple_New(2);
+ PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong(it->caid));
+ PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong((it++)->capid));
+ PyList_SET_ITEM(ret, cnt, tuple);
+ }
+ }
+ else
+ {
+ while(cnt--)
+ PyList_SET_ITEM(ret, cnt, PyInt_FromLong((it++)->caid));
+ }