From: <bi...@fr...> - 2005-07-13 10:06:18
|
CVS Root: /cvs/gstreamer Module: gst-python Changes by: bilboed Date: Wed Jul 13 2005 03:06:11 PDT Log message: * gst/gstbus.override: (bus_handler) (bus_sync_handler): Raise an exception if the callback doesn't return anything * gst/pygstminiobject.c: removed the 'ref' and 'unref' methods Modified files: . : ChangeLog gst : gstbus.override pygstminiobject.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/ChangeLog.diff?r1=1.180&r2=1.181 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/gst/gstbus.override.diff?r1=1.1&r2=1.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/gst/pygstminiobject.c.diff?r1=1.6&r2=1.7 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-python/ChangeLog,v retrieving revision 1.180 retrieving revision 1.181 diff -u -d -r1.180 -r1.181 --- ChangeLog 13 Jul 2005 10:03:04 -0000 1.180 +++ ChangeLog 13 Jul 2005 10:05:59 -0000 1.181 @@ -1,3 +1,11 @@ +2005-07-13 Edward Hervey <ed...@fl...> + + * gst/gstbus.override: (bus_handler) (bus_sync_handler): + Raise an exception if the callback doesn't return anything + * gst/pygstminiobject.c: + removed the 'ref' and 'unref' methods 2005-07-13 Andy Wingo <wi...@po...> * examples/pipeline-tester: Tweaks, show messages. Index: gstbus.override RCS file: /cvs/gstreamer/gst-python/gst/gstbus.override,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gstbus.override 12 Jul 2005 09:45:57 -0000 1.1 +++ gstbus.override 13 Jul 2005 10:05:59 -0000 1.2 @@ -55,7 +55,11 @@ PyErr_Print(); res = GST_BUS_PASS; } else { - if (pyg_enum_get_value(GST_TYPE_BUS_SYNC_REPLY, ret, (gint *) &res)) + if (ret == Py_None) { + PyErr_SetString(PyExc_TypeError, "callback should return a BusSyncReply"); + PyErr_Print(); + res = GST_BUS_PASS; + } else if (pyg_enum_get_value(GST_TYPE_BUS_SYNC_REPLY, ret, (gint *) &res)) res = GST_BUS_PASS; Py_DECREF (ret); } @@ -101,7 +105,12 @@ res = TRUE; - res = PyObject_IsTrue(ret); + PyErr_SetString(PyExc_TypeError, "callback should return True or False"); + res = TRUE; + } else + res = PyObject_IsTrue(ret); Py_DECREF(ret); Py_DECREF(args); Index: pygstminiobject.c RCS file: /cvs/gstreamer/gst-python/gst/pygstminiobject.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- pygstminiobject.c 12 Jul 2005 16:37:31 -0000 1.6 +++ pygstminiobject.c 13 Jul 2005 10:05:59 -0000 1.7 @@ -405,27 +405,10 @@ return pygstminiobject_new(gst_mini_object_copy(self->obj)); } -static PyObject * -pygstminiobject_ref(PyGstMiniObject *self, PyObject *args) -{ - gst_mini_object_ref(self->obj); - return (PyObject*) self; -} - -pygstminiobject_unref(PyGstMiniObject *self, PyObject *args) - Py_INCREF(Py_None); - return Py_None; static PyMethodDef pygstminiobject_methods[] = { { "__gstminiobject_init__", (PyCFunction)pygstminiobject__gstminiobject_init__, METH_VARARGS|METH_KEYWORDS }, { "copy", (PyCFunction)pygstminiobject_copy, METH_VARARGS, "Copies the miniobject"}, - { "ref", (PyCFunction)pygstminiobject_ref, METH_VARARGS, "Adds a reference to the miniobject" }, - { "unref", (PyCFunction)pygstminiobject_unref, METH_VARARGS, "Removes a reference from the miniobject"}, { NULL, NULL, 0 } }; |