[Galago-commits] r2620 - in trunk/galago-python: . src tests

galago-commits at freedesktop.org galago-commits at freedesktop.org
Thu Mar 23 20:29:52 PST 2006


Author: chipx86
Date: 2006-03-23 20:29:48 -0800 (Thu, 23 Mar 2006)
New Revision: 2620

Modified:
   trunk/galago-python/ChangeLog
   trunk/galago-python/src/galago.override
   trunk/galago-python/tests/get-presence.py
Log:
Add wrappings for galago_object_get_attributes().


Modified: trunk/galago-python/ChangeLog
===================================================================
--- trunk/galago-python/ChangeLog	2006-03-20 22:17:10 UTC (rev 2619)
+++ trunk/galago-python/ChangeLog	2006-03-24 04:29:48 UTC (rev 2620)
@@ -1,3 +1,9 @@
+Thu Mar 23 20:25:47 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/galago.override:
+	* tests/get-presence.py:
+	  - Add wrappings for galago_object_get_attributes().
+
 Mon Mar 20 00:26:18 PST 2006  Christian Hammond <chipx86 at chipx86.com>
 
 	* src/Makefile.am:

Modified: trunk/galago-python/src/galago.override
===================================================================
--- trunk/galago-python/src/galago.override	2006-03-20 22:17:10 UTC (rev 2619)
+++ trunk/galago-python/src/galago.override	2006-03-24 04:29:48 UTC (rev 2620)
@@ -349,6 +349,34 @@
 	return Py_None;
 }
 %%
+override galago_object_get_attributes noargs
+static PyObject *
+_wrap_galago_object_get_attributes(PyGObject *self)
+{
+	GList *attrs, *l;
+	PyObject *list;
+
+	list = PyList_New(0);
+
+	if (list == NULL)
+		return NULL;
+
+	attrs = galago_object_get_attributes(GALAGO_OBJECT(self->obj));
+
+	for (l = attrs; l != NULL; l = l->next)
+	{
+		GalagoKeyValue *key_value = (GalagoKeyValue *)l->data;
+		PyObject *tuple = PyTuple_New(2);
+
+		PyTuple_SetItem(tuple, 0, PyString_FromString(key_value->key));
+		PyTuple_SetItem(tuple, 1, pyg_value_as_pyobject(key_value->value,
+														FALSE));
+		PyList_Append(list, tuple);
+	}
+
+	return list;
+}
+%%
 override galago_person_get_accounts kwargs
 static PyObject *
 _wrap_galago_person_get_accounts(PyGObject *self, PyObject *args,
@@ -426,12 +454,4 @@
 									PyObject_IsTrue(query)));
 }
 %%
-override galago_status_get_attributes noargs
-static PyObject *
-_wrap_galago_status_get_attributes(PyGObject *self)
-{
-	return pygalago_wrap_gobj_list(
-		galago_status_get_attributes(GALAGO_STATUS(self->obj)));
-}
-%%
 // vim: ft=c

Modified: trunk/galago-python/tests/get-presence.py
===================================================================
--- trunk/galago-python/tests/get-presence.py	2006-03-20 22:17:10 UTC (rev 2619)
+++ trunk/galago-python/tests/get-presence.py	2006-03-24 04:29:48 UTC (rev 2620)
@@ -61,3 +61,10 @@
         print "\tType: %s" % get_name_from_status_type(status.get_primitive())
         print "\tID:   %s" % status.get_id()
         print "\tName: %s" % status.get_name()
+
+        attrs = status.get_attributes()
+
+        if len(attrs) > 0:
+            print "\tAttributes:"
+            for attr in attrs:
+                print "\t\t%s: %s" % (attr[0], attr[1])



More information about the galago-commits mailing list