From 840d8e2072b3fe0f845948174bb6ea74bc0f26ad Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 18 Oct 2005 10:17:06 +0000 Subject: [PATCH] Is your message repr t00 sma11? Original commit message from CVS: (_wrap_gst_message_tp_repr): Is your message repr t00 sma11? --- ChangeLog | 1 + gst/gstmessage.override | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2da5470112..92ebe11e17 100644 --- 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 diff --git a/gst/gstmessage.override b/gst/gstmessage.override index 1fd7039de7..71290e0d0a 100644 --- a/gst/gstmessage.override +++ b/gst/gstmessage.override @@ -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_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 ("", + structure_str, src_str, msg); + g_free (src_str); + g_free (structure_str); + ret = PyString_FromStringAndSize(repr, strlen (repr)); g_free (repr); + return ret; }