+commit 27dcb9b1963be0c0d18e19a0b108a4a64d5e048b
+Author: John (J5) Palmieri <johnp@redhat.com>
+Date: Mon Mar 21 12:42:36 2011 -0400
+
+ prep for 2.28.1 release
+
+ NEWS | 15 +++++++++++++++
+ 1 files changed, 15 insertions(+), 0 deletions(-)
+
+commit 072d45cbfa7b360a0e616c4c56ba75d4dc08e7df
+Author: John Stowers <john.stowers@gmail.com>
+Date: Sun Mar 6 23:41:30 2011 +1300
+
+ pygi-convert.sh remove gobject tests, GObject works now
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=644347
+
+ pygi-convert.sh | 28 ----------------------------
+ 1 files changed, 0 insertions(+), 28 deletions(-)
+
+commit 205fee1622e461c0bcbe50e8befe30f01aac81eb
+Author: John Stowers <john.stowers@gmail.com>
+Date: Sun Mar 6 23:41:01 2011 +1300
+
+ pygi-convert.sh add GObject.xxx and webkit
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=644347
+
+ pygi-convert.sh | 7 +++++++
+ 1 files changed, 7 insertions(+), 0 deletions(-)
+
+commit f5ee2924af489c17b64e56be5d2bd1c39d1293d1
+Author: John (J5) Palmieri <johnp@redhat.com>
+Date: Wed Mar 16 17:34:18 2011 -0400
+
+ [gi] marshal raw closures
+
+ * before we were able to marshal python callables into methods
+ that took
+ GClosures but we had no way to take a GClosure returned from one
+ method and pass it to another - this enables that usecase
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=644757
+
+ gi/pygi-argument.c | 15 ++++++++++-----
+ tests/test_gi.py | 4 ++++
+ 2 files changed, 14 insertions(+), 5 deletions(-)
+
+commit ac11dc70b34fe077be18f7e605c9f3cce03ad3fa
+Author: Martin Pitt <martin.pitt@ubuntu.com>
+Date: Mon Mar 21 13:25:12 2011 +0100
+
+ Revert "Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES"
+
+ This reverts commit fc7d7f7f153d57ff3866b7bfd5e6479d702cc4d9.
+
+ This introduces additional libpython dependencies, which breaks
+ distributions
+ which support multiple Python versions, and also causes the python
+ interpreter
+ to be in memory twice in some cases.
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=620215
+
+ gi/Makefile.am | 4 +---
+ gio/Makefile.am | 2 +-
+ glib/Makefile.am | 2 +-
+ m4/python.m4 | 7 ++-----
+ tests/Makefile.am | 2 +-
+ 5 files changed, 6 insertions(+), 11 deletions(-)
+
+commit aed7582de1c0623042601c8038a7631fa41d087d
+Author: Dieter Verfaillie <dieterv@optionexplicit.be>
+Date: Fri Mar 18 17:06:08 2011 +0100
+
+ setup.py: fix user_access_control option
+
+ setup.py | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+commit 6f0d33101a2451854f216291813951349d5ac471
+Author: John (J5) Palmieri <johnp@redhat.com>
+Date: Wed Mar 16 15:20:43 2011 -0400
+
+ [gi-overrides] fix marshalling pygobjects in treemodels
+
+ * PyGObjects wern't being marshalled correctly as python objects
+ when a
+ treemodel column was set to take pyobjects
+ * Fix this by explicetly marshalling all PyObjects as boxed gvalue
+ types
+ in the overrides
+
+ gi/overrides/Gtk.py | 9 +++++----
+ tests/test_overrides.py | 34 ++++++++++++++++++++++++++--------
+ 2 files changed, 31 insertions(+), 12 deletions(-)
+
+commit adb6f0320bed9a00a96c99424d4982199dc85af2
+Author: Martin Pitt <martin.pitt@ubuntu.com>
+Date: Wed Mar 16 10:22:35 2011 +0100
+
+ [gi] Respect the MessageType for Gtk.MessageDialog
+
+ Don't just ignore the type argument, actually pass it on. Thanks
+ to Tualatrix
+ Chou for spotting this!
+
+ gi/overrides/Gtk.py | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+commit 115c4750f071270b648218c9678931a65a4b3e3d
+Author: Martin Pitt <martin.pitt@ubuntu.com>
+Date: Tue Mar 15 10:22:39 2011 +0100
+
+ [gi] Do not require signature for D-BUS methods without arguments
+
+ Calling methods on DBusProxy objects usually requires specifying
+ the signature
+ as first argument. However, if the D-BUS method does not take any
+ arguments,
+ specifying the empty '()' signature does not give any additional
+ information,
+ so allow the caller to just call the proxy method without any
+ arguments.
+
+ Also ensure that passing a non-string signature raises a
+ comprehensible
+ exception, instead of crashing deep in the GVariant leaf constructor.
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=644260
+
+ gi/overrides/Gio.py | 16 +++++++++++++++-
+ tests/test_gdbus.py | 13 +++++++++++++
+ 2 files changed, 28 insertions(+), 1 deletions(-)
+
+commit 0df9e153812e1e5077bb906449e211ecb0af8736
+Author: John (J5) Palmieri <johnp@redhat.com>
+Date: Fri Mar 11 14:09:02 2011 -0500
+
+ [gi-demos] add pickers demo
+
+ demos/gtk-demo/demos/pickers.py | 74
+ +++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 74 insertions(+), 0 deletions(-)
+
+commit 419bfdd44b566ffb88f71165c00728872987dc5e
+Author: John (J5) Palmieri <johnp@redhat.com>
+Date: Thu Mar 10 18:12:50 2011 -0500
+
+ [gi-demos] add menu demo
+
+ demos/gtk-demo/demos/menus.py | 122
+ +++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 122 insertions(+), 0 deletions(-)
+
+commit 0877670e184a591866cbf3ab14284fcb217b540b
+Author: John Stowers <john.stowers@gmail.com>
+Date: Sun Mar 6 23:05:33 2011 +1300
+
+ [gi-overrides] TreeViewColumn.set_cell_data_func func_data can be None
+
+ https://bugzilla.gnome.org/show_bug.cgi?id=644343
+
+ gi/overrides/Gtk.py | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+commit 1f69c520d95fec30094fac47cb0efa31c79da81c
+Author: John Stowers <john.stowers@gmail.com>
+Date: Sun Mar 6 17:48:04 2011 +1300
+
+ [gi-demos] dont try and run demos that represent directories
+
+ demos/gtk-demo/gtk-demo.py | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+commit f06ad511725b28d821532acae45a25d0a186fc9f
+Author: John (J5) Palmieri <johnp@redhat.com>
+Date: Wed Mar 9 13:02:50 2011 -0500
+
+ [gi-overrides] fix exception block so it works in Python 2.5
+
+ gi/overrides/Gio.py | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+commit a784350b6e76c6c66fb2856dd597238f4ac992e9
+Author: John (J5) Palmieri <johnp@redhat.com>
+Date: Tue Mar 8 13:25:57 2011 -0500
+
+ post release version bump
+
+ configure.ac | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
commit aa745352bb99862c360dc56e2fececc4b2968cbc
Author: John (J5) Palmieri <johnp@redhat.com>
Date: Tue Mar 8 13:20:31 2011 -0500
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
+2.28.1 21-Mar-2011
+ - pygi-convert.sh remove gobject tests, GObject works now (John Stowers)
+ - pygi-convert.sh add GObject.xxx and webkit (John Stowers)
+ - [gi] marshal raw closures (John (J5) Palmieri)
+ - Revert "Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES" (Martin Pit
+ - setup.py: fix user_access_control option (Dieter Verfaillie)
+ - [gi-overrides] fix marshalling pygobjects in treemodels (John (J5) Pal
+ - [gi] Respect the MessageType for Gtk.MessageDialog (Martin Pitt)
+ - [gi] Do not require signature for D-BUS methods without arguments (Mar
+ - [gi-demos] add pickers demo (John (J5) Palmieri)
+ - [gi-demos] add menu demo (John (J5) Palmieri)
+ - [gi-overrides] TreeViewColumn.set_cell_data_func func_data can be None
+ - [gi-demos] dont try and run demos that represent directories (John Sto
+ - [gi-overrides] fix exception block so it works in Python 2.5 (John (J5
+
2.28.0 08-Mar-2011 (stable)
- [gi-demos] some python 3 compat fixes (John (J5) Palmieri)
- [gi-demos] catch the correct error class (John (J5) Palmieri)
Metadata-Version: 1.0
Name: PyGObject
-Version: 2.28.0
+Version: 2.28.1
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/2.28/pygobject-2.28.0.tar.gz
+Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-2.28.1.tar.gz
Description: Python bindings for GLib, GObject and GIO
Platform: POSIX, Windows
Classifier: Development Status :: 5 - Production/Stable
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for pygobject 2.28.0.
+# Generated by GNU Autoconf 2.68 for pygobject 2.28.1.
#
# Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject>.
#
# Identity of this package.
PACKAGE_NAME='pygobject'
PACKAGE_TARNAME='pygobject'
-PACKAGE_VERSION='2.28.0'
-PACKAGE_STRING='pygobject 2.28.0'
+PACKAGE_VERSION='2.28.1'
+PACKAGE_STRING='pygobject 2.28.1'
PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject'
PACKAGE_URL=''
ENABLE_DOCS_TRUE
XSLTPROC
PLATFORM
-PYTHON_LIBS
PYTHON_INCLUDES
pkgpyexecdir
pyexecdir
# 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 2.28.0 to adapt to many kinds of systems.
+\`configure' configures pygobject 2.28.1 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 2.28.0:";;
+ short | recursive ) echo "Configuration of pygobject 2.28.1:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pygobject configure 2.28.0
+pygobject configure 2.28.1
generated by GNU Autoconf 2.68
Copyright (C) 2010 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 2.28.0, which was
+It was created by pygobject $as_me 2.28.1, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
PYGOBJECT_MINOR_VERSION=28
-$as_echo "#define PYGOBJECT_MICRO_VERSION 0" >>confdefs.h
+$as_echo "#define PYGOBJECT_MICRO_VERSION 1" >>confdefs.h
-PYGOBJECT_MICRO_VERSION=0
+PYGOBJECT_MICRO_VERSION=1
ac_config_headers="$ac_config_headers config.h"
# Define the identity of the package.
PACKAGE='pygobject'
- VERSION='2.28.0'
+ VERSION='2.28.1'
cat >>confdefs.h <<_ACEOF
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-pygobject config.lt 2.28.0
+pygobject config.lt 2.28.1
configured by $0, generated by GNU Autoconf 2.68.
Copyright (C) 2010 Free Software Foundation, Inc.
PYTHON_CONFIG=`which $PYTHON`-config
if test -x "$PYTHON_CONFIG"; then
PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null`
-PYTHON_LIBS=`$PYTHON_CONFIG --libs 2>/dev/null`
else
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
-PYTHON_LIBS="-lpython${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
fi
-
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
# 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 2.28.0, which was
+This file was extended by pygobject $as_me 2.28.1, which was
generated by GNU Autoconf 2.68. 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 2.28.0
+pygobject config.status 2.28.1
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
dnl the pygobject version number
m4_define(pygobject_major_version, 2)
m4_define(pygobject_minor_version, 28)
-m4_define(pygobject_micro_version, 0)
+m4_define(pygobject_micro_version, 1)
m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
dnl versions of packages we require ...
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
-export-symbols-regex "init_gi|PyInit__gi"
_gi_la_LIBADD = \
$(GI_LIBS) \
- $(PYTHON_LIBS) \
$(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@.la
_gi_la_SOURCES = \
pygi-repository.c \
-export-symbols-regex "init_gi_cairo|PyInit__gi_cairo"
_gi_cairo_la_LIBADD = \
$(GI_LIBS) \
- $(PYCAIRO_LIBS) \
- $(PYTHON_LIBS)
+ $(PYCAIRO_LIBS)
_gi_cairo_la_SOURCES = pygi-foreign-cairo.c
am__installdirs = "$(DESTDIR)$(pygidir)" "$(DESTDIR)$(pygidir)"
LTLIBRARIES = $(pygi_LTLIBRARIES)
am__DEPENDENCIES_1 =
-_gi_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+_gi_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@.la
am__gi_la_OBJECTS = _gi_la-pygi-repository.lo _gi_la-pygi-info.lo \
_gi_la-pygi-invoke.lo _gi_la-pygi-foreign.lo \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(_gi_la_CFLAGS) $(CFLAGS) \
$(_gi_la_LDFLAGS) $(LDFLAGS) -o $@
_gi_cairo_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1)
am__gi_cairo_la_OBJECTS = _gi_cairo_la-pygi-foreign-cairo.lo
_gi_cairo_la_OBJECTS = $(am__gi_cairo_la_OBJECTS)
_gi_cairo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
_gi_la_LIBADD = \
$(GI_LIBS) \
- $(PYTHON_LIBS) \
$(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@.la
_gi_la_SOURCES = \
_gi_cairo_la_LIBADD = \
$(GI_LIBS) \
- $(PYCAIRO_LIBS) \
- $(PYTHON_LIBS)
+ $(PYCAIRO_LIBS)
_gi_cairo_la_SOURCES = pygi-foreign-cairo.c
pygi_LTLIBRARIES = _gi.la $(am__append_1)
from gi.repository import GLib
+import sys
+
Gio = modules['Gio']._introspection_module
__all__ = []
(result_callback, error_callback, real_user_data) = user_data
try:
ret = obj.call_finish(result)
- except Exception as e:
+ except Exception:
+ etype, e = sys.exc_info()[:2]
# return exception as value
if error_callback:
error_callback(obj, e, real_user_data)
result_callback(obj, self._unpack_result(ret), real_user_data)
- def __call__(self, signature, *args, **kwargs):
+ def __call__(self, *args, **kwargs):
+ # the first positional argument is the signature, unless we are calling
+ # a method without arguments; then signature is implied to be '()'.
+ if args:
+ signature = args[0]
+ args = args[1:]
+ if not isinstance(signature, str):
+ raise TypeError('first argument must be the method signature string: %r' % signature)
+ else:
+ signature = '()'
+
arg_variant = GLib.Variant(signature, tuple(args))
if 'result_handler' in kwargs:
proxy = Gio.DBusProxy.new_sync(...)
result = proxy.MyMethod('(is)', 42, 'hello')
+ The exception are methods which take no arguments, like
+ proxy.MyMethod('()'). For these you can omit the signature and just write
+ proxy.MyMethod().
+
Optional keyword arguments:
- timeout: timeout for the call in milliseconds (default to D-Bus timeout)
kwds['text'] = message_format
Gtk.MessageDialog.__init__(self,
_buttons_property=buttons,
+ message_type=type,
**kwds)
Dialog.__init__(self, parent=parent, flags=flags)
# we may need to convert to a basic type
type_ = self.get_column_type(column)
- if type_ == GObject.TYPE_PYOBJECT:
- pass # short-circut branching
- elif type_ == GObject.TYPE_STRING:
+ if type_ == GObject.TYPE_STRING:
if isinstance(value, str):
value = str(value)
elif sys.version_info < (3, 0):
# so we don't have to do it here
value_container = GObject.Value()
value_container.init(type_)
- if type_ == GObject.TYPE_CHAR:
+ if type_ == GObject.TYPE_PYOBJECT:
+ value_container.set_boxed(value)
+ value = value_container
+ elif type_ == GObject.TYPE_CHAR:
value_container.set_char(value)
value = value_container
elif type_ == GObject.TYPE_UCHAR:
if success:
return (start_pos, width,)
+ def set_cell_data_func(self, cell_renderer, func, func_data=None):
+ super(TreeViewColumn, self).set_cell_data_func(cell_renderer, func, func_data)
TreeViewColumn = override(TreeViewColumn)
__all__.append('TreeViewColumn')
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
/* Handle special cases. */
type = g_registered_type_info_get_g_type ( (GIRegisteredTypeInfo *) info);
if (g_type_is_a (type, G_TYPE_CLOSURE)) {
- if (!PyCallable_Check (object)) {
+ if (!(PyCallable_Check (object) ||
+ pyg_type_from_object_strict (object, FALSE) == G_TYPE_CLOSURE)) {
PyErr_Format (PyExc_TypeError, "Must be callable, not %s",
object->ob_type->tp_name);
retval = 0;
} else if (g_type_is_a (type, G_TYPE_CLOSURE)) {
GClosure *closure;
- closure = pyg_closure_new (object, NULL, NULL);
- if (closure == NULL) {
- PyErr_SetString (PyExc_RuntimeError, "PyObject conversion to GClosure failed");
- break;
+ if (pyg_type_from_object_strict (object, FALSE) == G_TYPE_CLOSURE) {
+ closure = (GClosure *)pyg_boxed_get (object, void);
+ } else {
+ closure = pyg_closure_new (object, NULL, NULL);
+ if (closure == NULL) {
+ PyErr_SetString (PyExc_RuntimeError, "PyObject conversion to GClosure failed");
+ break;
+ }
}
arg.v_pointer = closure;
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
unix.c: $(GIOUNIX_DEFS) unix.override
unix_la_CFLAGS = $(GIOUNIX_CFLAGS)
unix_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initunix
-unix_la_LIBADD = $(GIOUNIX_LIBS) $(PYTHON_LIBS)
+unix_la_LIBADD = $(GIOUNIX_LIBS)
unix_la_SOURCES = unixmodule.c
nodist_unix_la_SOURCES = unix.c
if BUILD_GIOUNIX
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(_gio_la_CFLAGS) \
$(CFLAGS) $(_gio_la_LDFLAGS) $(LDFLAGS) -o $@
@BUILD_GIO_TRUE@am__gio_la_rpath = -rpath $(pkgpyexecdir)
-unix_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+unix_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_unix_la_OBJECTS = unix_la-unixmodule.lo
nodist_unix_la_OBJECTS = unix_la-unix.lo
unix_la_OBJECTS = $(am_unix_la_OBJECTS) $(nodist_unix_la_OBJECTS)
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
GIOUNIX_DEFS = unix.defs unix-types.defs unix.override
unix_la_CFLAGS = $(GIOUNIX_CFLAGS)
unix_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initunix
-unix_la_LIBADD = $(GIOUNIX_LIBS) $(PYTHON_LIBS)
+unix_la_LIBADD = $(GIOUNIX_LIBS)
unix_la_SOURCES = unixmodule.c
nodist_unix_la_SOURCES = unix.c
all: all-am
endif
libpyglib_2_0_@PYTHON_BASENAME@_la_CFLAGS = $(GLIB_CFLAGS)
-libpyglib_2_0_@PYTHON_BASENAME@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS) $(PYTHON_LIBS)
+libpyglib_2_0_@PYTHON_BASENAME@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS)
libpyglib_2_0_@PYTHON_BASENAME@_la_SOURCES = \
pyglib.c \
pyglib.h \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(_glib_la_CFLAGS) \
$(CFLAGS) $(_glib_la_LDFLAGS) $(LDFLAGS) -o $@
libpyglib_2_0_@PYTHON_BASENAME@_la_DEPENDENCIES = \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am_libpyglib_2_0_@PYTHON_BASENAME@_la_OBJECTS = \
libpyglib_2_0_@PYTHON_BASENAME@_la-pyglib.lo
libpyglib_2_0_@PYTHON_BASENAME@_la_OBJECTS = \
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
pyglib_LTLIBRARIES = _glib.la
common_ldflags = -module -avoid-version $(am__append_1)
libpyglib_2_0_@PYTHON_BASENAME@_la_CFLAGS = $(GLIB_CFLAGS)
-libpyglib_2_0_@PYTHON_BASENAME@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS) $(PYTHON_LIBS)
+libpyglib_2_0_@PYTHON_BASENAME@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS)
libpyglib_2_0_@PYTHON_BASENAME@_la_SOURCES = \
pyglib.c \
pyglib.h \
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
-dnl function also defines PYTHON_INCLUDES and PYTHON_LIBS
+dnl function also defines PYTHON_INCLUDES
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
-dnl deduce PYTHON_INCLUDES and PYTHON_LIBS
+dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`
PYTHON_CONFIG=`which $PYTHON`-config
if test -x "$PYTHON_CONFIG"; then
PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null`
-PYTHON_LIBS=`$PYTHON_CONFIG --libs 2>/dev/null`
else
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
-PYTHON_LIBS="-lpython${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
fi
AC_SUBST(PYTHON_INCLUDES)
-AC_SUBST(PYTHON_LIBS)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
doclines = __doc__.split('\n')
options = {'bdist_wininst': {'install_script': 'pygobject_postinstall.py',
- 'user-access-control': 'auto'}}
+ 'user_access_control': 'auto'}}
setup(name='pygobject',
url='http://www.pygtk.org/',
testhelper_la_CFLAGS = -I$(top_srcdir)/gobject -I$(top_srcdir)/glib $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
testhelper_la_LDFLAGS = -module -avoid-version
-testhelper_la_LIBADD = $(GLIB_LIBS) $(PYTHON_LIBS)
+testhelper_la_LIBADD = $(GLIB_LIBS)
testhelper_la_SOURCES = \
testhelpermodule.c \
test-floating.c \
$(CFLAGS) $(libregress_la_LDFLAGS) $(LDFLAGS) -o $@
@ENABLE_INTROSPECTION_TRUE@am_libregress_la_rpath =
am__DEPENDENCIES_1 =
-testhelper_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
+testhelper_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_testhelper_la_OBJECTS = testhelper_la-testhelpermodule.lo \
testhelper_la-test-floating.lo testhelper_la-test-thread.lo \
testhelper_la-test-unknown.lo
PYTHON_BASENAME = @PYTHON_BASENAME@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
-PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
@ENABLE_INTROSPECTION_TRUE@libgimarshallingtests_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS)
testhelper_la_CFLAGS = -I$(top_srcdir)/gobject -I$(top_srcdir)/glib $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
testhelper_la_LDFLAGS = -module -avoid-version
-testhelper_la_LIBADD = $(GLIB_LIBS) $(PYTHON_LIBS)
+testhelper_la_LIBADD = $(GLIB_LIBS)
testhelper_la_SOURCES = \
testhelpermodule.c \
test-floating.c \
self.assertTrue('Timeout' in str(e), str(e))
+ def test_python_calls_sync_noargs(self):
+ # methods without arguments don't need an explicit signature
+ result = self.dbus_proxy.ListNames()
+ self.assertTrue(isinstance(result, list))
+ self.assertTrue(len(result) > 1)
+ self.assertTrue('org.freedesktop.DBus' in result)
+
def test_python_calls_sync_errors(self):
# error case: invalid argument types
try:
self.assertTrue('InvalidArgs' in str(e), str(e))
+ try:
+ self.dbus_proxy.GetConnectionUnixProcessID(None, 'foo')
+ self.fail('call with None signature should raise an exception')
+ except TypeError as e:
+ self.assertTrue('signature' in str(e), str(e))
+
def test_python_calls_async(self):
def call_done(obj, result, user_data):
user_data['result'] = result
def test_gclosure_in(self):
GIMarshallingTests.gclosure_in(lambda: 42)
+ # test passing a closure between two C calls
+ closure = GIMarshallingTests.gclosure_return()
+ GIMarshallingTests.gclosure_in(closure)
+
self.assertRaises(TypeError, GIMarshallingTests.gclosure_in, 42)
self.assertRaises(TypeError, GIMarshallingTests.gclosure_in, None)
class TestPyObject(object):
pass
+ class TestPyGObject(GObject.Object):
+ __gtype_name__ = 'TestPyGObject'
+ def __init__(self, i):
+ GObject.Object.__init__(self)
+ self.sentinal = i + 5
+
test_pyobj = TestPyObject()
test_pydict = {1:1, "2":2, "3":"3"}
test_pylist = [1,"2", "3"]
- list_store = Gtk.ListStore(int, str, 'GIOverrideTreeAPITest', object, object, object, bool, bool)
+ list_store = Gtk.ListStore(int, str, 'GIOverrideTreeAPITest', object, object, object, bool, bool, object)
for i in range(93):
label = 'this is row #%d' % i
testobj = TestGtk.TestClass(self, i, label)
+ testpygobj = TestPyGObject(i)
parent = list_store.append((i,
label,
testobj,
test_pydict,
test_pylist,
i % 2,
- bool(i % 2)))
+ bool(i % 2),
+ testpygobj))
i = 93
label = _unicode('this is row #93')
list_store.set_value(treeiter, 5, test_pylist)
list_store.set_value(treeiter, 6, 1)
list_store.set_value(treeiter, 7, True)
+ list_store.set_value(treeiter, 8, TestPyGObject(i))
# test automatic unicode->str conversion
i = 94
test_pydict,
test_pylist,
0,
- False))
+ False,
+ TestPyGObject(i)))
# add sorted items out of order to test insert* apis
# also test sending in None to not set a column
None,
test_pylist,
1,
- None))
+ None,
+ TestPyGObject(i)))
list_store.set_value(treeiter, 0, i)
list_store.set_value(treeiter, 1, label)
test_pydict,
test_pylist,
1,
- True))
+ True,
+ TestPyGObject(i)))
i = 96
label = 'this is row #96'
test_pydict,
test_pylist,
0,
- False))
+ False,
+ TestPyGObject(i)))
i = 98
label = 'this is row #98'
test_pydict,
test_pylist,
0,
- False))
+ False,
+ TestPyGObject(i)))
i = 95
test_pydict,
test_pylist,
1,
- True))
+ True,
+ TestPyGObject(i)))
self.assertEquals(len(list_store), 100)
self.assertTrue(isinstance(bool_1, bool))
self.assertTrue(isinstance(bool_2, bool))
+ pygobj = list_store.get_value(treeiter, 8)
+ self.assertEquals(pygobj.sentinal, i + 5)
+
treeiter = list_store.iter_next(treeiter)
counter += 1