+commit ad8b7d1a89eb2d030a504d521f7589a4c1d835fb
+Author: Martin Pitt <martinpitt@gnome.org>
+Date: Mon Sep 2 14:38:41 2013 +0200
+
+ release 3.9.91
+
+ NEWS | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+commit 9df8eb79929025f12d51bc7f79b1d160156c2755
+Author: Simon Feltman <sfeltman@src.gnome.org>
+Date: Mon Sep 2 04:19:35 2013 -0700
+
+ Fix GObject signal methods to work with new annotations
+
+ Add conditional support for signal methods annotated as gpointer
+ or GObject.Object. This is needed to work with newer versions of
+ glib which changed annotations to GObject.Object (bug #685387).
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=707280
+
+ gi/overrides/GObject.py | 106
+ ++++++++++++++++++++++++++++++------------------
+ 1 file changed, 66 insertions(+), 40 deletions(-)
+
+commit 9b6b6c7ee6a621cba99f51857eadd622a1535118
+Author: Chun-wei Fan <fanchunwei@src.gnome.org>
+Date: Thu Aug 15 14:41:40 2013 +0800
+
+ Fix build on C89 Compilers
+
+ Avoid a variable declaration at the middle of the block
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=707264
+
+ gi/pygi-closure.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 19c1a2dfb91a83a6fb0ca76b9c95c42a49a3736e
+Author: Simon Feltman <sfeltman@src.gnome.org>
+Date: Sun Sep 1 20:44:26 2013 -0700
+
+ Change boxed type checking in marshaling to use __gtype__ attribute
+
+ Replace usage of pyg_boxed_check(pyboxed) with g_type_is_a and
+ pyg_type_from_object. This has the effect of using the __gtype__
+ attribute stashed on object class instead of the PyGBoxed
+ internally held gtype. This fixes type descrepencies for objects
+ marshaled into overridden signal class closures and passed back
+ to functions taking an alias their type.
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=707140
+
+ gi/pygi-marshal-from-py.c | 8 +++++++-
+ tests/test_overrides_gtk.py | 34 ++++++++++++++++++++++++++++++++++
+ 2 files changed, 41 insertions(+), 1 deletion(-)
+
+commit dab0c09f1996e124ca98334e5aea0852904b44b5
+Author: Simon Feltman <sfeltman@src.gnome.org>
+Date: Sun Sep 1 17:49:09 2013 -0700
+
+ Use G_IS_VALUE for checking return values in closure marshaling
+
+ Replace return_value argument NULL checks in GClosureMarshal
+ implementations with G_IS_VALUE. This checks both NULL and
+ validity of the value (!= G_TYPE_INVALID). This is needed
+ because GLib can pass either NULL or an invalid value based
+ on whether or not G_ENABLE_DEBUG is set.
+ See: https://bugzilla.gnome.org/show_bug.cgi?id=707249
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=707170
+
+ gi/_gobject/pygtype.c | 4 ++--
+ gi/pygi-signal-closure.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+commit c7b75a8c250078ac8ea28752f087ed687bd20edd
+Author: Yanko Kaneti <yaneti@declera.com>
+Date: Wed Aug 21 08:53:07 2013 +0200
+
+ Fix PEP-8 errors in propertyhelper.py
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=706319
+
+ Signed-off-by: Martin Pitt <martinpitt@gnome.org>
+
+ gi/_gobject/propertyhelper.py | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+commit 6fdd58404103596accb6ab04d4de33846d853c58
+Author: Martin Pitt <martinpitt@gnome.org>
+Date: Mon Aug 19 17:13:30 2013 +0200
+
+ configure.ac: post-release bump to 3.9.91
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
commit 6fbe2580deda215896e9583b418b8bc1aceb2f96
Author: Martin Pitt <martinpitt@gnome.org>
Date: Mon Aug 19 17:10:52 2013 +0200
+3.9.91 02-Sep-2013
+ - Fix GObject signal methods to work with new annotations
+ (Simon Feltman) (#707280)
+ - Fix build on C89 Compilers (Chun-wei Fan) (#707264)
+ - Change boxed type checking in marshaling to use __gtype__ attribute
+ (Simon Feltman) (#707140)
+ - Use G_IS_VALUE for checking return values in closure marshaling
+ (Simon Feltman) (#707170)
+ - Fix PEP-8 errors in propertyhelper.py (Yanko Kaneti) (#706319)
+
3.9.90 19-Aug-2013
- Create GLib.Pid in the same way on python 2 and 3 (Benjamin Berg)
(#705451)
Metadata-Version: 1.0
Name: PyGObject
-Version: 3.9.90
+Version: 3.9.91
Summary: Python bindings for GObject
Home-page: http://www.pygtk.org/
Author: James Henstridge
Maintainer: Johan Dahlin
Maintainer-email: johan@gnome.org
License: GNU LGPL
-Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.9/pygobject-3.9.90.tar.gz
+Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.9/pygobject-3.9.91.tar.gz
Description: Python bindings for GLib and GObject
Platform: POSIX, Windows
Classifier: Development Status :: 5 - Production/Stable
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for pygobject 3.9.90.
+# Generated by GNU Autoconf 2.69 for pygobject 3.9.91.
#
# Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject>.
#
# Identity of this package.
PACKAGE_NAME='pygobject'
PACKAGE_TARNAME='pygobject'
-PACKAGE_VERSION='3.9.90'
-PACKAGE_STRING='pygobject 3.9.90'
+PACKAGE_VERSION='3.9.91'
+PACKAGE_STRING='pygobject 3.9.91'
PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject'
PACKAGE_URL='https://live.gnome.org/PyGObject/'
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures pygobject 3.9.90 to adapt to many kinds of systems.
+\`configure' configures pygobject 3.9.91 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pygobject 3.9.90:";;
+ short | recursive ) echo "Configuration of pygobject 3.9.91:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pygobject configure 3.9.90
+pygobject configure 3.9.91
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pygobject $as_me 3.9.90, which was
+It was created by pygobject $as_me 3.9.91, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
PYGOBJECT_MINOR_VERSION=9
-$as_echo "#define PYGOBJECT_MICRO_VERSION 90" >>confdefs.h
+$as_echo "#define PYGOBJECT_MICRO_VERSION 91" >>confdefs.h
-PYGOBJECT_MICRO_VERSION=90
+PYGOBJECT_MICRO_VERSION=91
ac_config_headers="$ac_config_headers config.h"
# Define the identity of the package.
PACKAGE='pygobject'
- VERSION='3.9.90'
+ VERSION='3.9.91'
cat >>confdefs.h <<_ACEOF
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by pygobject $as_me 3.9.90, which was
+This file was extended by pygobject $as_me 3.9.91, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-pygobject config.status 3.9.90
+pygobject config.status 3.9.91
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
dnl the pygobject version number
m4_define(pygobject_major_version, 3)
m4_define(pygobject_minor_version, 9)
-m4_define(pygobject_micro_version, 90)
+m4_define(pygobject_micro_version, 91)
m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
dnl versions of packages we require ...
if minimum is not None:
if minimum < self._get_minimum():
raise TypeError(
- "Minimum for type %s cannot be lower than %d" % (
- self.type, self._get_minimum()))
+ "Minimum for type %s cannot be lower than %d" %
+ (self.type, self._get_minimum()))
else:
minimum = self._get_minimum()
self.minimum = minimum
if maximum is not None:
if maximum > self._get_maximum():
raise TypeError(
- "Maximum for type %s cannot be higher than %d" % (
- self.type, self._get_maximum()))
+ "Maximum for type %s cannot be higher than %d" %
+ (self.type, self._get_maximum()))
else:
maximum = self._get_maximum()
self.maximum = maximum
raise TypeError(
"GObject subclass %r defines do_get/set_property"
" and it also uses a property with a custom setter"
- " or getter. This is not allowed" % (
- cls.__name__,))
+ " or getter. This is not allowed" %
+ (cls.__name__,))
def obj_get_property(self, pspec):
name = pspec.name.replace('-', '_')
goto out;
}
- if (return_value && pyg_value_from_pyobject(return_value, ret) != 0) {
+ if (G_IS_VALUE(return_value) && pyg_value_from_pyobject(return_value, ret) != 0) {
/* If we already have an exception set, use that, otherwise set a
* generic one */
if (!PyErr_Occurred())
}
Py_DECREF(method);
Py_DECREF(params);
- if (return_value)
+ if (G_IS_VALUE(return_value))
pyg_value_from_pyobject(return_value, ret);
Py_DECREF(ret);
pyglib_gil_state_release(state);
__all__.append('signal_query')
+# Check needed for glib versions which annotate signal related methods
+# with a void pointer instead of GObject.Object.
+# See: https://bugzilla.gnome.org/show_bug.cgi?id=685387
+_is_first_signal_arg_void = GObjectModule.signal_stop_emission.get_arguments()[0].get_pytype_hint() == 'void'
+
+
def _get_instance_for_signal(obj):
- if isinstance(obj, GObjectModule.Object):
+ if not _is_first_signal_arg_void:
+ return obj
+ elif isinstance(obj, GObjectModule.Object):
return obj.__gpointer__
else:
raise TypeError('Unsupported object "%s" for signal function' % obj)
-def _wrap_signal_func(func):
- @functools.wraps(func)
- def wrapper(obj, *args, **kwargs):
- return func(_get_instance_for_signal(obj), *args, **kwargs)
- return wrapper
-
-
class _HandlerBlockManager(object):
def __init__(self, obj, handler_id):
self.obj = obj
__all__.append('signal_handler_block')
-# The following functions wrap GI functions but coerce the first arg into
-# something compatible with gpointer
-
-signal_handler_unblock = _wrap_signal_func(GObjectModule.signal_handler_unblock)
-signal_handler_disconnect = _wrap_signal_func(GObjectModule.signal_handler_disconnect)
-signal_handler_is_connected = _wrap_signal_func(GObjectModule.signal_handler_is_connected)
-signal_stop_emission = _wrap_signal_func(GObjectModule.signal_stop_emission)
-signal_stop_emission_by_name = _wrap_signal_func(GObjectModule.signal_stop_emission_by_name)
-signal_has_handler_pending = _wrap_signal_func(GObjectModule.signal_has_handler_pending)
-signal_get_invocation_hint = _wrap_signal_func(GObjectModule.signal_get_invocation_hint)
-signal_connect_closure = _wrap_signal_func(GObjectModule.signal_connect_closure)
-signal_connect_closure_by_id = _wrap_signal_func(GObjectModule.signal_connect_closure_by_id)
-signal_handler_find = _wrap_signal_func(GObjectModule.signal_handler_find)
-signal_handlers_destroy = _wrap_signal_func(GObjectModule.signal_handlers_destroy)
-signal_handlers_block_matched = _wrap_signal_func(GObjectModule.signal_handlers_block_matched)
-signal_handlers_unblock_matched = _wrap_signal_func(GObjectModule.signal_handlers_unblock_matched)
-signal_handlers_disconnect_matched = _wrap_signal_func(GObjectModule.signal_handlers_disconnect_matched)
-
-__all__ += ['signal_handler_unblock',
- 'signal_handler_disconnect', 'signal_handler_is_connected',
- 'signal_stop_emission', 'signal_stop_emission_by_name',
- 'signal_has_handler_pending', 'signal_get_invocation_hint',
- 'signal_connect_closure', 'signal_connect_closure_by_id',
- 'signal_handler_find', 'signal_handlers_destroy',
- 'signal_handlers_block_matched', 'signal_handlers_unblock_matched',
- 'signal_handlers_disconnect_matched']
+if _is_first_signal_arg_void:
+ # The following functions wrap GI functions but coerce the first arg into
+ # something compatible with gpointer
+
+ def _wrap_signal_func(func):
+ @functools.wraps(func)
+ def wrapper(obj, *args, **kwargs):
+ return func(_get_instance_for_signal(obj), *args, **kwargs)
+ return wrapper
+
+ signal_handler_unblock = _wrap_signal_func(GObjectModule.signal_handler_unblock)
+ signal_handler_disconnect = _wrap_signal_func(GObjectModule.signal_handler_disconnect)
+ signal_handler_is_connected = _wrap_signal_func(GObjectModule.signal_handler_is_connected)
+ signal_stop_emission = _wrap_signal_func(GObjectModule.signal_stop_emission)
+ signal_stop_emission_by_name = _wrap_signal_func(GObjectModule.signal_stop_emission_by_name)
+ signal_has_handler_pending = _wrap_signal_func(GObjectModule.signal_has_handler_pending)
+ signal_get_invocation_hint = _wrap_signal_func(GObjectModule.signal_get_invocation_hint)
+ signal_connect_closure = _wrap_signal_func(GObjectModule.signal_connect_closure)
+ signal_connect_closure_by_id = _wrap_signal_func(GObjectModule.signal_connect_closure_by_id)
+ signal_handler_find = _wrap_signal_func(GObjectModule.signal_handler_find)
+ signal_handlers_destroy = _wrap_signal_func(GObjectModule.signal_handlers_destroy)
+ signal_handlers_block_matched = _wrap_signal_func(GObjectModule.signal_handlers_block_matched)
+ signal_handlers_unblock_matched = _wrap_signal_func(GObjectModule.signal_handlers_unblock_matched)
+ signal_handlers_disconnect_matched = _wrap_signal_func(GObjectModule.signal_handlers_disconnect_matched)
+
+ __all__ += ['signal_handler_unblock',
+ 'signal_handler_disconnect', 'signal_handler_is_connected',
+ 'signal_stop_emission', 'signal_stop_emission_by_name',
+ 'signal_has_handler_pending', 'signal_get_invocation_hint',
+ 'signal_connect_closure', 'signal_connect_closure_by_id',
+ 'signal_handler_find', 'signal_handlers_destroy',
+ 'signal_handlers_block_matched', 'signal_handlers_unblock_matched',
+ 'signal_handlers_disconnect_matched']
+else:
+ # First signal arg is GObject.Object but we need these as globals for
+ # our GObject.Object class override below
+ signal_handler_disconnect = GObjectModule.signal_handler_disconnect
+ signal_handler_unblock = GObjectModule.signal_handler_unblock
+ signal_handler_disconnect = GObjectModule.signal_handler_disconnect
+ signal_handler_is_connected = GObjectModule.signal_handler_is_connected
+ signal_stop_emission_by_name = GObjectModule.signal_stop_emission_by_name
def signal_parse_name(detailed_signal, itype, force_detail_quark):
self.obj.thaw_notify()
+def _signalmethod(func):
+ # Function wrapper for signal functions used as instance methods.
+ # This is needed when the signal functions come directly from GI.
+ # (they are not already wrapped)
+ @functools.wraps(func)
+ def meth(*args, **kwargs):
+ return func(*args, **kwargs)
+ return meth
+
+
class Object(GObjectModule.Object):
def _unsupported_method(self, *args, **kargs):
raise RuntimeError('This method is currently unsupported.')
# Aliases
#
- disconnect = signal_handler_disconnect
- handler_block = signal_handler_block
- handler_unblock = signal_handler_unblock
- handler_disconnect = signal_handler_disconnect
- handler_is_connected = signal_handler_is_connected
- stop_emission_by_name = signal_stop_emission_by_name
+ disconnect = _signalmethod(signal_handler_disconnect)
+ handler_block = _signalmethod(signal_handler_block)
+ handler_unblock = _signalmethod(signal_handler_unblock)
+ handler_disconnect = _signalmethod(signal_handler_disconnect)
+ handler_is_connected = _signalmethod(signal_handler_is_connected)
+ stop_emission_by_name = _signalmethod(signal_stop_emission_by_name)
#
# Deprecated Methods
GITransfer transfer)
{
GIArgument arg = _pygi_argument_from_object (object, type_info, transfer);
+ GITypeTag type_tag;
if (PyErr_Occurred ())
return;
- GITypeTag type_tag = g_type_info_get_tag (type_info);
+ type_tag = g_type_info_get_tag (type_info);
if (retval == NULL)
return;
}
if (g_type_is_a (g_type, G_TYPE_BOXED)) {
- if (pyg_boxed_check (py_arg, g_type)) {
+ /* Use pyg_type_from_object to pull the stashed __gtype__ attribute
+ * off of the input argument instead of checking PyGBoxed.gtype
+ * with pyg_boxed_check. This is needed to work around type discrepancies
+ * in cases with aliased (typedef) types. e.g. GtkAllocation, GdkRectangle.
+ * See: https://bugzilla.gnomethere are .org/show_bug.cgi?id=707140
+ */
+ if (g_type_is_a (pyg_type_from_object (py_arg), g_type)) {
arg->v_pointer = pyg_boxed_get (py_arg, void);
if (transfer == GI_TRANSFER_EVERYTHING) {
arg->v_pointer = g_boxed_copy (g_type, arg->v_pointer);
goto out;
}
- if (return_value && pyg_value_from_pyobject(return_value, ret) != 0) {
+ if (G_IS_VALUE(return_value) && pyg_value_from_pyobject(return_value, ret) != 0) {
PyErr_SetString(PyExc_TypeError,
"can't convert return value to desired type");
@unittest.skipUnless(Gtk, 'Gtk not available')
+class TestSignals(unittest.TestCase):
+ class WindowWithSizeAllocOverride(Gtk.ScrolledWindow):
+ __gsignals__ = {'size-allocate': 'override'}
+
+ def __init__(self):
+ Gtk.ScrolledWindow.__init__(self)
+ self._alloc_called = False
+ self._alloc_value = None
+ self._alloc_error = None
+
+ def do_size_allocate(self, alloc):
+ self._alloc_called = True
+ self._alloc_value = alloc
+
+ try:
+ Gtk.ScrolledWindow.do_size_allocate(self, alloc)
+ except Exception as e:
+ self._alloc_error = e
+
+ def test_class_closure_override_with_aliased_type(self):
+ win = self.WindowWithSizeAllocOverride()
+ rect = Gdk.Rectangle()
+ rect.width = 100
+ rect.height = 100
+
+ with realized(win):
+ win.show()
+ win.size_allocate(rect)
+ self.assertTrue(win._alloc_called)
+ self.assertIsInstance(win._alloc_value, Gdk.Rectangle)
+ self.assertTrue(win._alloc_error is None, win._alloc_error)
+
+
+@unittest.skipUnless(Gtk, 'Gtk not available')
class TestBuilder(unittest.TestCase):
class SignalTest(GObject.GObject):
__gtype_name__ = "GIOverrideSignalTest"