Is your message repr t00 sma11?
authorAndy Wingo <wingo@pobox.com>
Tue, 18 Oct 2005 10:17:06 +0000 (10:17 +0000)
committerAndy Wingo <wingo@pobox.com>
Tue, 18 Oct 2005 10:17:06 +0000 (10:17 +0000)
Original commit message from CVS:
(_wrap_gst_message_tp_repr): Is your message repr t00 sma11?

ChangeLog
gst/gstmessage.override

index 2da5470..92ebe11 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * gst/gstmessage.override (_wrap_gst_message_tp_repr): Add a repr
        for messages.
+       (_wrap_gst_message_tp_repr): Is your message repr t00 sma11?
 
 2005-10-14  Edward Hervey  <edward@fluendo.com>
 
index 1fd7039..71290e0 100644 (file)
@@ -26,17 +26,25 @@ static PyObject *
 _wrap_gst_message_tp_repr (PyGstMiniObject *self)
 {
     GstMessage *msg;
-    gchar *repr;
+    gchar *repr, *structure_str, *src_str;
     PyObject *ret;
 
     g_assert (self);
     msg = GST_MESSAGE (self->obj);
     g_assert (msg);
 
-    repr = g_strdup_printf ("<gst.Message %s at %p>",
-        gst_message_type_get_name (GST_MESSAGE_TYPE (msg)), msg);
+    structure_str = msg->structure ? gst_structure_to_string (msg->structure)
+        : g_strdup ("(none)");
+    src_str = msg->src ? gst_object_get_name (msg->src) : g_strdup ("(no src)");
+
+    repr = g_strdup_printf ("<gst.Message %s from %s at %p>",
+        structure_str, src_str, msg);
+    g_free (src_str);
+    g_free (structure_str);
+
     ret = PyString_FromStringAndSize(repr, strlen (repr));
     g_free (repr);
+
     return ret;
 }