Is your message repr t00 sma11?

Original commit message from CVS:
(_wrap_gst_message_tp_repr): Is your message repr t00 sma11?
This commit is contained in:
Andy Wingo 2005-10-18 10:17:06 +00:00
parent 9cd2add463
commit 840d8e2072
2 changed files with 12 additions and 3 deletions

View file

@ -2,6 +2,7 @@
* gst/gstmessage.override (_wrap_gst_message_tp_repr): Add a repr * gst/gstmessage.override (_wrap_gst_message_tp_repr): Add a repr
for messages. for messages.
(_wrap_gst_message_tp_repr): Is your message repr t00 sma11?
2005-10-14 Edward Hervey <edward@fluendo.com> 2005-10-14 Edward Hervey <edward@fluendo.com>

View file

@ -26,17 +26,25 @@ static PyObject *
_wrap_gst_message_tp_repr (PyGstMiniObject *self) _wrap_gst_message_tp_repr (PyGstMiniObject *self)
{ {
GstMessage *msg; GstMessage *msg;
gchar *repr; gchar *repr, *structure_str, *src_str;
PyObject *ret; PyObject *ret;
g_assert (self); g_assert (self);
msg = GST_MESSAGE (self->obj); msg = GST_MESSAGE (self->obj);
g_assert (msg); g_assert (msg);
repr = g_strdup_printf ("<gst.Message %s at %p>", structure_str = msg->structure ? gst_structure_to_string (msg->structure)
gst_message_type_get_name (GST_MESSAGE_TYPE (msg)), msg); : 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)); ret = PyString_FromStringAndSize(repr, strlen (repr));
g_free (repr); g_free (repr);
return ret; return ret;
} }