[rhythmbox] python: drop some old compatibility code



commit bb1a33b94d3d68b87597cef8c71d91177f63f21a
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sun Apr 4 08:19:54 2010 +1000

    python: drop some old compatibility code
    
    Also use pygobject's pkg-config file, not pygtk's, to find codegen and
    h2def.

 bindings/python/Makefile.am |    6 +++---
 configure.ac                |   19 ++++++++-----------
 shell/rb-python-module.c    |   34 ----------------------------------
 3 files changed, 11 insertions(+), 48 deletions(-)
---
diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
index 8786452..a0c4bfb 100644
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -33,14 +33,14 @@ rb_la_CFLAGS = \
 	$(WNOERROR_CFLAGS)
 
 rhythmdb.c: rhythmdb.defs rhythmdb.override
-	( cd $(srcdir) && $(PYGTK_CODEGEN) \
+	( cd $(srcdir) && $(PYGOBJECT_CODEGEN) \
 		--register $(PYGTK_DEFSDIR)/gtk-types.defs \
 		--register $(GST_PYTHON_DEFSDIR)/gst-types.defs \
 		--override $*.override \
 		--prefix py$* $(<F) ) > $@ 
 
 rb.c: rb.defs rb.override
-	( cd $(srcdir) && $(PYGTK_CODEGEN) \
+	( cd $(srcdir) && $(PYGOBJECT_CODEGEN) \
 		--register $(PYGTK_DEFSDIR)/gtk-types.defs \
 		--register $(PYGTK_DEFSDIR)/gdk-base-types.defs \
 		--register $(GST_PYTHON_DEFSDIR)/gst-types.defs \
@@ -89,7 +89,7 @@ BINDING_HEADERS_SRCDIR		:= $(addprefix $(top_srcdir)/,$(BINDING_HEADERS_SRCDIR_I
 BINDING_HEADERS_BUILDDIR	:= $(addprefix $(top_builddir)/,$(BINDING_HEADERS_BUILDDIR_IN))
 
 regenerate-python-binding:
-	$(PYGTK_H2DEF) $(sort $(BINDING_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > rhythmbox.defs.new
+	$(PYGOBJECT_H2DEF) $(sort $(BINDING_HEADERS_SRCDIR) $(BINDING_HEADERS_BUILDDIR)) > rhythmbox.defs.new
 
 BUILT_SOURCES = rhythmdb.c rb.c
 
diff --git a/configure.ac b/configure.ac
index 8b2d87d..0b85901 100644
--- a/configure.ac
+++ b/configure.ac
@@ -705,21 +705,18 @@ if test "x$have_python" != "xno"; then
 	GST_PYTHON_DEFSDIR=`$PKG_CONFIG --variable=defsdir gst-python-0.10`
 	AC_MSG_RESULT([$GST_PYTHON_DEFSDIR])
 
-	AC_MSG_CHECKING([for pygtk codegen])
-	PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
-	AC_MSG_RESULT([$PYGTK_CODEGEN])
+	AC_MSG_CHECKING([for pygobject codegen])
+	PYGOBJECT_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygobject-2.0`/codegen.py"
+	AC_MSG_RESULT([$PYGOBJECT_CODEGEN])
 
-	AC_MSG_CHECKING([for pygtk h2def])
-	PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
-	AC_MSG_RESULT([$PYGTK_H2DEF])
+	AC_MSG_CHECKING([for pygobject h2def])
+	PYGOBJECT_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygobject-2.0`/h2def.py"
+	AC_MSG_RESULT([$PYGOBJECT_H2DEF])
 
 	AC_SUBST([PYGTK_DEFSDIR])
 	AC_SUBST([GST_PYTHON_DEFSDIR])
-	AC_SUBST([PYGTK_CODEGEN])
-	AC_SUBST([PYGTK_H2DEF])
-
-	PKG_CHECK_EXISTS([pygobject-2.0 >= 2.13.2],
-			 AC_DEFINE([PYGOBJECT_CAN_MARSHAL_GVALUE], [1], [Define if pygobject can marshal GValues]))
+	AC_SUBST([PYGOBJECT_CODEGEN])
+	AC_SUBST([PYGOBJECT_H2DEF])
 fi
 
 if test "x$have_python" != "xno" -a "x$enable_python" != "xno"; then
diff --git a/shell/rb-python-module.c b/shell/rb-python-module.c
index 5aa2fd7..9e14731 100644
--- a/shell/rb-python-module.c
+++ b/shell/rb-python-module.c
@@ -71,35 +71,6 @@ enum
 	PROP_MODULE
 };
 
-#ifndef PYGOBJECT_CAN_MARSHAL_GVALUE
-static PyObject *
-pyg_value_g_value_as_pyobject (const GValue *value)
-{
-	return pyg_value_as_pyobject((GValue *)g_value_get_boxed(value), FALSE);
-}
-
-static int
-pyg_value_g_value_from_pyobject (GValue *value, PyObject *obj)
-{
-	GType type;
-	GValue obj_value = { 0, };
-
-	type = pyg_type_from_object((PyObject *) obj->ob_type);
-	if (! type) {
-		PyErr_Clear();
-		return -1;
-	}
-	g_value_init(&obj_value, type);
-	if (pyg_value_from_pyobject(&obj_value, obj) == -1) {
-		g_value_unset(&obj_value);
-		return -1;
-	}
-	g_value_set_boxed(value, &obj_value);
-	g_value_unset(&obj_value);
-	return 0;
-}
-#endif /* PYGOBJECT_CAN_MARSHAL_GVALUE */
-
 /* Exported by pyrhythmdb module */
 void pyrhythmdb_register_classes (PyObject *d);
 void pyrhythmdb_add_constants (PyObject *module, const gchar *strip_prefix);
@@ -180,12 +151,7 @@ rb_python_module_init_python (void)
 	}
 
 	/* disable pyg* log hooks, since ours is more interesting */
-#ifdef pyg_disable_warning_redirections
 	pyg_disable_warning_redirections ();
-#endif
-#ifndef PYGOBJECT_CAN_MARSHAL_GVALUE
-	pyg_register_gtype_custom (G_TYPE_VALUE, pyg_value_g_value_as_pyobject, pyg_value_g_value_from_pyobject);
-#endif
 
 	/* import gtk */
 	init_pygtk ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]