diff -purN gnome-python-desktop-2.16.0.ORIG/gnomekeyring/gnomekeyring-argtypes.py gnome-python-desktop-2.16.0/gnomekeyring/gnomekeyring-argtypes.py --- gnome-python-desktop-2.16.0.ORIG/gnomekeyring/gnomekeyring-argtypes.py 2006-05-16 16:35:24.000000000 -0500 +++ gnome-python-desktop-2.16.0/gnomekeyring/gnomekeyring-argtypes.py 2009-01-08 09:48:02.000000000 -0600 @@ -11,6 +11,13 @@ class AttrList(argtypes.ArgType): info.arglist.append(pname) info.codeafter.append(" gnome_keyring_attribute_list_free(%(pname)s);\n" % vars()) + def write_return(self, ptype, ownsreturn, info): + info.varlist.add('GnomeKeyringAttributeList*', 'ret') + info.codeafter.append('return pygnome_keyring_attribute_list_as_pyobject(ret);') + + + + argtypes.matcher.register('GnomeKeyringAttributeList*', AttrList()) class GnomeKeyringResultArg(argtypes.IntArg): diff -purN gnome-python-desktop-2.16.0.ORIG/gnomekeyring/gnomekeyring.defs gnome-python-desktop-2.16.0/gnomekeyring/gnomekeyring.defs --- gnome-python-desktop-2.16.0.ORIG/gnomekeyring/gnomekeyring.defs 2006-05-16 16:35:24.000000000 -0500 +++ gnome-python-desktop-2.16.0/gnomekeyring/gnomekeyring.defs 2009-01-08 09:48:02.000000000 -0600 @@ -88,6 +88,17 @@ (gtype-id "GNOME_KEYRING_TYPE_APPLICATION_REF") ) +(define-boxed Found + (in-module "Gnome") + (c-name "GnomeKeyringFound") + (gtype-id "GNOME_KEYRING_TYPE_FOUND") + (fields + '("gchar*" "keyring") + '("guint" "item_id") + '("GnomeKeyringAttributeList*" "attributes") + '("gchar*" "secret")) +) + ;; From /opt/gnome-devel/include/gnome-keyring-1/gnome-keyring.h (define-method append_string diff -purN gnome-python-desktop-2.16.0.ORIG/gnomekeyring/gnomekeyring.override gnome-python-desktop-2.16.0/gnomekeyring/gnomekeyring.override --- gnome-python-desktop-2.16.0.ORIG/gnomekeyring/gnomekeyring.override 2009-01-08 09:45:52.000000000 -0600 +++ gnome-python-desktop-2.16.0/gnomekeyring/gnomekeyring.override 2009-01-08 09:48:03.000000000 -0600 @@ -71,6 +71,36 @@ pygnome_keyring_access_control_get_type( } #endif /* #ifndef GNOME_KEYRING_ACCESS_CONTROL_TYPE */ +#ifndef GNOME_KEYRING_TYPE_FOUND +# define GNOME_KEYRING_TYPE_FOUND pygnome_keyring_found_get_type() +GnomeKeyringFound * +pygnome_keyring_found_copy (GnomeKeyringFound *found) +{ + GnomeKeyringFound *copy; + + copy = g_new (GnomeKeyringFound, 1); + memcpy (copy, found, sizeof (GnomeKeyringFound)); + + copy->keyring = g_strdup (copy->keyring); + copy->attributes = gnome_keyring_attribute_list_copy (copy->attributes); + copy->secret = g_strdup (copy->secret); + + return copy; +} + +static GType +pygnome_keyring_found_get_type(void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static("PyGnomeKeyringFound", + (GBoxedCopyFunc)pygnome_keyring_found_copy, + (GBoxedFreeFunc)gnome_keyring_found_free); + return our_type; +} +#endif /* #ifndef GNOME_KEYRING_ACCESS_CONTROL_TYPE */ + static GnomeKeyringAttributeList * pygnome_keyring_attribute_list_from_pyobject(PyObject *py_attrlist) { @@ -525,8 +555,8 @@ _wrap_gnome_keyring_find_items_sync(PyOb GnomeKeyringItemType type; gint ret; PyObject * py_attributes; - GList *ids = NULL, *l; - PyObject *py_ids; + GList *found = NULL, *l; + PyObject *py_found; if (!PyArg_ParseTupleAndKeywords(args, kwargs,"OO:find_items_sync", kwlist, &py_type, &py_attributes)) return NULL; @@ -536,21 +566,20 @@ _wrap_gnome_keyring_find_items_sync(PyOb if (!attributes) return NULL; pyg_begin_allow_threads; - ret = gnome_keyring_find_items_sync(type, attributes, &ids); + ret = gnome_keyring_find_items_sync(type, attributes, &found); pyg_end_allow_threads; gnome_keyring_attribute_list_free(attributes); - py_ids = PyList_New(0); - for (l = ids; l; l = l->next) + py_found = PyList_New(0); + for (l = found; l; l = l->next) { - PyObject *item; - item = PyLong_FromUnsignedLong(GPOINTER_TO_UINT(l->data)); - PyList_Append(py_ids, item); + PyObject *item = pyg_boxed_new(GNOME_KEYRING_TYPE_FOUND, l->data, FALSE, TRUE); + PyList_Append(py_found, item); Py_DECREF(item); } - g_list_free(ids); + g_list_free(found); if (pygnomekeyring_result_check(ret)) return NULL; - return py_ids; + return py_found; }