diff options
author | Emmanuel Bouthenot <kolter@openics.org> | 2005-07-12 14:58:42 +0000 |
---|---|---|
committer | Emmanuel Bouthenot <kolter@openics.org> | 2005-07-12 14:58:42 +0000 |
commit | 8a6d35cf125822357c2957492ce952cf572e596b (patch) | |
tree | 35fe4958fceb44455f418667dd386c07a51686ad | |
parent | d286f3922c15630f97555cdd87f0715b588b4031 (diff) | |
download | weechat-8a6d35cf125822357c2957492ce952cf572e596b.zip |
change return type from tuple to list for get_info('dccs') feature
-rw-r--r-- | src/plugins/python/wee-python.c | 18 | ||||
-rw-r--r-- | weechat/src/plugins/python/wee-python.c | 18 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/plugins/python/wee-python.c b/src/plugins/python/wee-python.c index 7475bbb24..8b3f9927a 100644 --- a/src/plugins/python/wee-python.c +++ b/src/plugins/python/wee-python.c @@ -373,17 +373,17 @@ wee_python_get_info (PyObject *self, PyObject *args) if (nbdccs == 0) return Py_None; - PyObject *tuple = PyTuple_New(nbdccs); + PyObject *list = PyList_New(nbdccs); - if (!tuple) + if (!list) return Py_None; - PyObject *tuplevalue; + PyObject *listvalue; int pos = 0; for(; p; p = p->next_dcc) { - tuplevalue = Py_BuildValue("{s:k,s:k,s:s,s:s,s:s,s:i,s:k,s:k,s:i,s:i}", + listvalue = Py_BuildValue("{s:k,s:k,s:s,s:s,s:s,s:i,s:k,s:k,s:i,s:i}", "address32", p->addr, "cps", p->bytes_per_sec, "remote_file", p->filename, @@ -394,12 +394,12 @@ wee_python_get_info (PyObject *self, PyObject *args) "size", p->size, "status", p->status, "type", p->type); - if (tuplevalue) + if (listvalue) { - if (PyTuple_SetItem(tuple, pos, tuplevalue) != 0) + if (PyList_SetItem(list, pos, listvalue) != 0) { - PyMem_Free(tuplevalue); - PyMem_Free(tuple); + PyMem_Free(listvalue); + PyMem_Free(list); return Py_None; } } @@ -408,7 +408,7 @@ wee_python_get_info (PyObject *self, PyObject *args) pos++; } - return tuple; + return list; } if (info) diff --git a/weechat/src/plugins/python/wee-python.c b/weechat/src/plugins/python/wee-python.c index 7475bbb24..8b3f9927a 100644 --- a/weechat/src/plugins/python/wee-python.c +++ b/weechat/src/plugins/python/wee-python.c @@ -373,17 +373,17 @@ wee_python_get_info (PyObject *self, PyObject *args) if (nbdccs == 0) return Py_None; - PyObject *tuple = PyTuple_New(nbdccs); + PyObject *list = PyList_New(nbdccs); - if (!tuple) + if (!list) return Py_None; - PyObject *tuplevalue; + PyObject *listvalue; int pos = 0; for(; p; p = p->next_dcc) { - tuplevalue = Py_BuildValue("{s:k,s:k,s:s,s:s,s:s,s:i,s:k,s:k,s:i,s:i}", + listvalue = Py_BuildValue("{s:k,s:k,s:s,s:s,s:s,s:i,s:k,s:k,s:i,s:i}", "address32", p->addr, "cps", p->bytes_per_sec, "remote_file", p->filename, @@ -394,12 +394,12 @@ wee_python_get_info (PyObject *self, PyObject *args) "size", p->size, "status", p->status, "type", p->type); - if (tuplevalue) + if (listvalue) { - if (PyTuple_SetItem(tuple, pos, tuplevalue) != 0) + if (PyList_SetItem(list, pos, listvalue) != 0) { - PyMem_Free(tuplevalue); - PyMem_Free(tuple); + PyMem_Free(listvalue); + PyMem_Free(list); return Py_None; } } @@ -408,7 +408,7 @@ wee_python_get_info (PyObject *self, PyObject *args) pos++; } - return tuple; + return list; } if (info) |