Index: ephy-python/epiphany.override =================================================================== RCS file: /cvs/gnome/pyphany/ephy-python/epiphany.override,v retrieving revision 1.16 diff -u -r1.16 epiphany.override --- ephy-python/epiphany.override 12 Feb 2005 17:22:51 -0000 1.16 +++ ephy-python/epiphany.override 2 May 2005 19:36:36 -0000 @@ -83,6 +83,28 @@ return py_list; } +static PyObject * +_helper_wrap_gobject_glist (GList *list) +{ + PyObject *py_list; + GList *tmp; + + if ((py_list = PyList_New(0)) == NULL) { + return NULL; + } + for (tmp = list; tmp != NULL; tmp = tmp->next) { + PyObject *py_obj = pygobject_new(G_OBJECT(tmp->data)); + + if (py_obj == NULL) { + Py_DECREF(py_list); + return NULL; + } + PyList_Append(py_list, py_obj); + Py_DECREF(py_obj); + } + return py_list; +} + static void free_boxed_type (gpointer data, gpointer type) { @@ -174,27 +196,15 @@ static PyObject * _wrap_ephy_window_get_tabs(PyGObject *self) { - GList *list, *tmp; + GList *list; PyObject *py_list; list = ephy_window_get_tabs(EPHY_WINDOW (self->obj)); - if ((py_list = PyList_New(0)) == NULL) { - g_list_free(list); - return NULL; - } - for (tmp = list; tmp != NULL; tmp = tmp->next) { - PyObject *gtk_obj = pygobject_new(G_OBJECT(tmp->data)); + py_list = _helper_wrap_gobject_glist (list); - if (gtk_obj == NULL) { - g_list_free(list); - Py_DECREF(py_list); - return NULL; - } - PyList_Append(py_list, gtk_obj); - Py_DECREF(gtk_obj); - } g_list_free(list); + return py_list; } %% @@ -361,4 +371,19 @@ return _helper_wrap_boxed_gptrarray (EPHY_TYPE_NODE, list, FALSE, FALSE); } +%% +override ephy_session_get_windows noargs +static PyObject * +_wrap_ephy_session_get_windows (PyGObject *self) +{ + GList *list; + PyObject *py_list; + + list = ephy_session_get_windows (EPHY_SESSION (self->obj)); + + py_list = _helper_wrap_gobject_glist (list); + g_list_free(list); + + return py_list; +}