Support time lists via python

This commit is contained in:
TingPing 2013-05-18 15:13:05 -03:00
parent 02298c8e76
commit a22ae9f39a

View File

@ -1907,6 +1907,7 @@ Module_xchat_get_list(PyObject *self, PyObject *args)
PyObject *attr = NULL; PyObject *attr = NULL;
const char *sattr; const char *sattr;
int iattr; int iattr;
time_t tattr;
switch(fields[i][0]) { switch(fields[i][0]) {
case 's': case 's':
sattr = hexchat_list_str(ph, list, (char*)fld); sattr = hexchat_list_str(ph, list, (char*)fld);
@ -1916,6 +1917,10 @@ Module_xchat_get_list(PyObject *self, PyObject *args)
iattr = hexchat_list_int(ph, list, (char*)fld); iattr = hexchat_list_int(ph, list, (char*)fld);
attr = PyLong_FromLong((long)iattr); attr = PyLong_FromLong((long)iattr);
break; break;
case 't':
tattr = hexchat_list_time(ph, list, (char*)fld);
attr = PyLong_FromLong((long)tattr);
break;
case 'p': case 'p':
sattr = hexchat_list_str(ph, list, (char*)fld); sattr = hexchat_list_str(ph, list, (char*)fld);
if (strcmp(fld, "context") == 0) { if (strcmp(fld, "context") == 0) {