Hello community,
here is the log from the commit of package python-gobject2
checked in at Sat Oct 21 21:35:31 CEST 2006.
--------
--- python-gobject2/python-gobject2.changes 2006-10-01 15:28:13.000000000 +0200
+++ /mounts/work_src_done/STABLE/python-gobject2/python-gobject2.changes 2006-10-21 13:45:36.000000000 +0200
@@ -1,0 +2,12 @@
+Sat Oct 21 13:45:11 CEST 2006 - cthiel@suse.de
+
+- update to version 2.12.2
+ * Make PyGObject 64-bit safe for Python 2.5
+ * All headers are now LGPL and not GPL
+ * Remove a couple of GCC warnings
+ * Revive distutils support
+ * Emission hook reference count bugfix
+ * MSVC/ANSI C compilation fix
+ * Bump Ctrl-C timeout handler from 100ms to 1000
+
+-------------------------------------------------------------------
Old:
----
pygobject-2.12.1.tar.bz2
New:
----
pygobject-2.12.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-gobject2.spec ++++++
--- /var/tmp/diff_new_pack.uYeL5y/_old 2006-10-21 21:34:56.000000000 +0200
+++ /var/tmp/diff_new_pack.uYeL5y/_new 2006-10-21 21:34:56.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package python-gobject2 (Version 2.12.1)
+# spec file for package python-gobject2 (Version 2.12.2)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -8,13 +8,14 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+# norootforbuild
Name: python-gobject2
Buildrequires: python-devel glib2-devel
Summary: Python bindings for GObject
-Version: 2.12.1
+Version: 2.12.2
Release: 1
-License: LGPL
+License: GNU Library General Public License v. 2.0 and 2.1 (LGPL)
Group: Development/Libraries/Python
URL: http://ftp.gnome.org/pub/GNOME/sources/pygobject/
Source: pygobject-%{version}.tar.bz2
@@ -81,6 +82,15 @@
%{_datadir}/gtk-doc
%changelog -n python-gobject2
+* Sat Oct 21 2006 - cthiel@suse.de
+- update to version 2.12.2
+ * Make PyGObject 64-bit safe for Python 2.5
+ * All headers are now LGPL and not GPL
+ * Remove a couple of GCC warnings
+ * Revive distutils support
+ * Emission hook reference count bugfix
+ * MSVC/ANSI C compilation fix
+ * Bump Ctrl-C timeout handler from 100ms to 1000
* Sun Oct 01 2006 - cthiel@suse.de
- update to version 2.12.1
* Corrected version check
++++++ pygobject-2.12.1.tar.bz2 -> pygobject-2.12.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/ChangeLog new/pygobject-2.12.2/ChangeLog
--- old/pygobject-2.12.1/ChangeLog 2006-09-05 01:07:50.000000000 +0200
+++ new/pygobject-2.12.2/ChangeLog 2006-10-03 22:24:52.000000000 +0200
@@ -1,3 +1,78 @@
+=== 2.12.2 ===
+2006-10-03 Johan Dahlin
+
+ * NEWS:
+ * configure.ac: 2.12.2
+
+2006-10-03 Gustavo J. A. M. Carneiro
+
+ * gobject/Makefile.am:
+ * gobject/gobjectmodule.c: (add_signals), (add_properties),
+ (pyg_signal_new), (pyg_object_new), (get_handler_priority),
+ (pyg_io_add_watch), (pyg_spawn_async), (pyg_add_emission_hook),
+ (pyg_remove_emission_hook), (pyg_filename_from_utf8),
+ (_pyg_strv_to_gvalue):
+ * gobject/pygiochannel.c: (py_io_channel_write_chars),
+ (py_io_channel_write_lines):
+ * gobject/pygobject-private.h:
+ * gobject/pygobject.c: (PyGProps_length), (pygobject_init),
+ (pygobject_connect), (pygobject_connect_after),
+ (pygobject_connect_object), (pygobject_connect_object_after),
+ (pygobject_disconnect), (pygobject_handler_is_connected),
+ (pygobject_handler_block), (pygobject_handler_unblock),
+ (pygobject_emit), (pygobject_chain_from_overridden):
+ * gobject/pygoptioncontext.c: (pyg_option_context_parse):
+ * gobject/pygtype.c: (pyg_value_from_pyobject):
+
+ Python 2.5 and 64 bits fixes (Py_ssize_t), closes bug #338487.
+
+ * gobject/pygenum.c (pyg_enum_repr): Const warning fix.
+
+2006-09-29 Johan Dahlin
+
+ * pygtk.py: LGPL, not GPL header
+
+2006-09-24 Gustavo J. A. M. Carneiro
+
+ * gobject/pygobject.h (init_pygobject_check): Add parentheses
+ "around && within ||" to please gcc.
+
+2006-09-21 Cedric Gustin
+
+ * dsextras.py: Catch ImportError exception when codegen is not
+ available: disable Template and TemplateExtension, redirect the
+ user to the pygtk installer and raise a NameError
+ exception. check_date has also been rewritten and now uses
+ distutils.dep_util.newer_group(). defs files can also be built
+ using createdefs by passing tuples as keyword argument to Template
+ (see for example the gdk and gtk templates in setup.py).
+ * setup.py: Changed the way the VERSION macro is defined on win32.
+ Also install the html reference documentation, the xsl files and
+ fixxref.
+ * pygobject_postinstall.py: Set the value of DATADIR in
+ fixxref.py. Add functions to install shortcuts in the Start menu
+ to the reference manual (currently disabled: see bug #353849).
+
+2006-09-16 Gustavo J. A. M. Carneiro
+
+ * tests/test_signal.py (TestEmissionHook.testCallbackReturnFalse)
+ (TestEmissionHook.testCallbackReturnTrue)
+ (TestEmissionHook.testCallbackReturnTrueButRemove): Add a few more
+ emission hook tests.
+
+ * gobject/gobjectmodule.c (pyg_add_emission_hook): One too many
+ DECREF on 'extra_args'.
+
+2006-09-12 John Ehresman
+
+ * gobject/pygobject.h (init_pygobject_check): Declare variables
+ at start of code block
+
+2006-09-06 Johan Dahlin
+
+ * gobject/pygmainloop.c (pyg_signal_watch_prepare): Increase the timeout
+ to 1000ms instead of 100.
+
=== 2.12.1 ===
2006-09-04 Johan Dahlin
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/NEWS new/pygobject-2.12.2/NEWS
--- old/pygobject-2.12.1/NEWS 2006-09-05 01:05:21.000000000 +0200
+++ new/pygobject-2.12.2/NEWS 2006-10-03 22:24:04.000000000 +0200
@@ -1,3 +1,12 @@
+2.12.2 3-october-2006
+ - Make PyGObject 64-bit safe for Python 2.5 (Gustavo)
+ - All headers are now LGPL and not GPL (Johan)
+ - Remove a couple of GCC warnings (Gustavo)
+ - Revive distutils support (Cedric Gustin)
+ - Emission hook reference count bugfix (Gustavo)
+ - MSVC/ANSI C compilation fix (John Ehresman)
+ - Bump Ctrl-C timeout handler from 100ms to 1000 (Johan)
+
2.12.1 4-september-2006
- Corrected version check (Sebastian Dröge, #354364)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/PKG-INFO new/pygobject-2.12.2/PKG-INFO
--- old/pygobject-2.12.1/PKG-INFO 2006-09-04 22:49:14.000000000 +0200
+++ new/pygobject-2.12.2/PKG-INFO 2006-10-03 22:25:36.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: PyGObject
-Version: 2.12.1
+Version: 2.12.2
Summary: Python bindings for GObject
Home-page: http://www.pygtk.org/
Author: James Henstridge
@@ -8,7 +8,7 @@
Maintainer: Johan Dahlin
Maintainer-email: johan@gnome.org
License: GNU LGPL
-Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.12/pygobject-2.12.1.tar.gz
+Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/2.12/pygobject-2.12.2.tar.gz
Description: Python bindings for GObject
Platform: POSIX, Windows
Classifier: Development Status :: 5 - Production/Stable
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/configure new/pygobject-2.12.2/configure
--- old/pygobject-2.12.1/configure 2006-09-04 22:47:39.000000000 +0200
+++ new/pygobject-2.12.2/configure 2006-10-03 22:25:29.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for pygobject 2.12.1.
+# Generated by GNU Autoconf 2.59 for pygobject 2.12.2.
#
# Report bugs to http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject.
#
@@ -419,8 +419,8 @@
# Identity of this package.
PACKAGE_NAME='pygobject'
PACKAGE_TARNAME='pygobject'
-PACKAGE_VERSION='2.12.1'
-PACKAGE_STRING='pygobject 2.12.1'
+PACKAGE_VERSION='2.12.2'
+PACKAGE_STRING='pygobject 2.12.2'
PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject'
ac_unique_file="gobject/gobjectmodule.c"
@@ -930,7 +930,7 @@
# 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.12.1 to adapt to many kinds of systems.
+\`configure' configures pygobject 2.12.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -996,7 +996,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pygobject 2.12.1:";;
+ short | recursive ) echo "Configuration of pygobject 2.12.2:";;
esac
cat <<\_ACEOF
@@ -1131,7 +1131,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-pygobject configure 2.12.1
+pygobject configure 2.12.2
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1145,7 +1145,7 @@
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.12.1, which was
+It was created by pygobject $as_me 2.12.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1500,10 +1500,10 @@
cat >>confdefs.h <<\_ACEOF
-#define PYGOBJECT_MICRO_VERSION 1
+#define PYGOBJECT_MICRO_VERSION 2
_ACEOF
-PYGOBJECT_MICRO_VERSION=1
+PYGOBJECT_MICRO_VERSION=2
@@ -1809,7 +1809,7 @@
# Define the identity of the package.
PACKAGE='pygobject'
- VERSION='2.12.1'
+ VERSION='2.12.2'
cat >>confdefs.h <<_ACEOF
@@ -10461,7 +10461,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by pygobject $as_me 2.12.1, which was
+This file was extended by pygobject $as_me 2.12.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -10524,7 +10524,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-pygobject config.status 2.12.1
+pygobject config.status 2.12.2
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/configure.ac new/pygobject-2.12.2/configure.ac
--- old/pygobject-2.12.1/configure.ac 2006-09-04 22:41:19.000000000 +0200
+++ new/pygobject-2.12.2/configure.ac 2006-10-03 22:24:44.000000000 +0200
@@ -4,7 +4,7 @@
dnl the pygobject version number
m4_define(pygobject_major_version, 2)
m4_define(pygobject_minor_version, 12)
-m4_define(pygobject_micro_version, 1)
+m4_define(pygobject_micro_version, 2)
m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
dnl versions of packages we require ...
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/dsextras.py new/pygobject-2.12.2/dsextras.py
--- old/pygobject-2.12.1/dsextras.py 2006-07-07 22:58:33.000000000 +0200
+++ new/pygobject-2.12.2/dsextras.py 2006-09-25 14:54:13.000000000 +0200
@@ -1,14 +1,13 @@
#
-# dsextras.py - Extra classes and utilities
-#
-# TODO:
-# Make it possible to import codegen from another dir
-#
+# dsextras.py - Extra classes and utilities for distutils, adding
+# pkg-config support
+
from distutils.command.build_ext import build_ext
from distutils.command.install_lib import install_lib
from distutils.command.install_data import install_data
from distutils.extension import Extension
+import distutils.dep_util
import fnmatch
import os
import re
@@ -80,10 +79,11 @@
retval.append(os.path.join(dir, file))
return retval
-def pkgc_version_check(name, longname, req_version):
+def pkgc_version_check(name, req_version):
+ """Check the existence and version number of a package:
+ returns 0 if not installed or too old, 1 otherwise."""
is_installed = not os.system('pkg-config --exists %s' % name)
if not is_installed:
- print "Could not find %s" % longname
return 0
orig_version = getoutput('pkg-config --modversion %s' % name)
@@ -92,12 +92,8 @@
if version >= pkc_version:
return 1
- else:
- print "Warning: Too old version of %s" % longname
- print " Need %s, but %s is installed" % \
- (pkc_version, orig_version)
- self.can_build_ok = 0
- return 0
+
+ return 0
class BuildExt(build_ext):
def init_extra_compile_args(self):
@@ -213,10 +209,10 @@
return output
def get_outputs(self):
- return install_lib.get_outputs(self) + self.local_outputs
+ return install_data.get_outputs(self) + self.local_outputs
def get_inputs(self):
- return install_lib.get_inputs(self) + self.local_inputs
+ return install_data.get_inputs(self) + self.local_inputs
class PkgConfigExtension(Extension):
# Name of pygobject package extension depends on, can be None
@@ -301,44 +297,81 @@
def generate(self):
pass
-class Template:
+# The Template and TemplateExtension classes require codegen which is
+# currently part of the pygtk distribution. While codegen might ultimately
+# be moved to pygobject, it was decided (bug #353849) to keep the Template
+# and TemplateExtension code in dsextras. In the meantime, we check for the
+# availability of codegen and redirect the user to the pygtk installer if
+# he/she wants to get access to Template and TemplateExtension.
+
+template_classes_enabled=True
+codegen_error_message="""
+***************************************************************************
+Codegen could not be found on your system and is required by the
+dsextras.Template and dsextras.TemplateExtension classes. codegen is part
+of PyGTK. To use either Template or TemplateExtension, you should also
+install PyGTK.
+***************************************************************************
+"""
+try:
+ from codegen.override import Overrides
+ from codegen.defsparser import DefsParser
+ from codegen.codegen import register_types, SourceWriter, \
+ FileOutput
+ import codegen.createdefs
+except ImportError, e:
+ template_classes_enabled=False
+
+class Template(object):
+ def __new__(cls,*args, **kwds):
+ if not template_classes_enabled:
+ raise NameError("'%s' is not defined\n" % cls.__name__
+ + codegen_error_message)
+ return object.__new__(cls,*args, **kwds)
+
def __init__(self, override, output, defs, prefix,
register=[], load_types=None):
+
self.override = override
- self.defs = defs
- self.register = register
self.output = output
self.prefix = prefix
self.load_types = load_types
- def check_dates(self):
- if not os.path.exists(self.output):
- return 0
+ self.built_defs=[]
+ if isinstance(defs,tuple):
+ self.defs=defs[0]
+ self.built_defs.append(defs)
+ else:
+ self.defs=defs
- files = self.register[:]
+ self.register=[]
+ for r in register:
+ if isinstance(r,tuple):
+ self.register.append(r[0])
+ self.built_defs.append(r)
+ else:
+ self.register.append(r)
+
+ def check_dates(self):
+ # Return True if files are up-to-date
+ files=self.register[:]
files.append(self.override)
-# files.append('setup.py')
files.append(self.defs)
- newest = 0
- for file in files:
- test = os.stat(file)[8]
- if test > newest:
- newest = test
+ return not distutils.dep_util.newer_group(files,self.output)
- if newest < os.stat(self.output)[8]:
- return 1
- return 0
+ def generate_defs(self):
+ for (target,sources) in self.built_defs:
+ if distutils.dep_util.newer_group(sources,target):
+ # createdefs is mostly called from the CLI !
+ args=['dummy',target]+sources
+ codegen.createdefs.main(args)
- def generate(self):
- # We must insert it first, otherwise python will try '.' first,
- # in which it exist a "bogus" codegen (the third import line
- # here will fail)
- sys.path.insert(0, 'codegen')
- from override import Overrides
- from defsparser import DefsParser
- from codegen import register_types, write_source, FileOutput
+ def generate(self):
+ # Generate defs files if necessary
+ self.generate_defs()
+ # ... then check the file timestamps
if self.check_dates():
return
@@ -356,17 +389,25 @@
register_types(dp)
fd = open(self.output, 'w')
- write_source(dp,
- Overrides(self.override),
- self.prefix,
- FileOutput(fd, self.output))
+ sw = SourceWriter(dp,Overrides(self.override),
+ self.prefix,FileOutput(fd,self.output))
+ sw.write()
fd.close()
class TemplateExtension(PkgConfigExtension):
+ def __new__(cls,*args, **kwds):
+ if not template_classes_enabled:
+ raise NameError("'%s' is not defined\n" % cls.__name__
+ + codegen_error_message)
+ return PkgConfigExtension.__new__(cls,*args, **kwds)
+
def __init__(self, **kwargs):
name = kwargs['name']
defs = kwargs['defs']
- output = defs[:-5] + '.c'
+ if isinstance(defs,tuple):
+ output = defs[0][:-5] + '.c'
+ else:
+ output = defs[:-5] + '.c'
override = kwargs['override']
load_types = kwargs.get('load_types')
self.templates = []
@@ -385,3 +426,5 @@
def generate(self):
map(lambda x: x.generate(), self.templates)
+
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/Makefile.am new/pygobject-2.12.2/gobject/Makefile.am
--- old/pygobject-2.12.1/gobject/Makefile.am 2006-04-29 20:55:04.000000000 +0200
+++ new/pygobject-2.12.2/gobject/Makefile.am 2006-10-03 16:03:43.000000000 +0200
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = 1.7
PLATFORM_VERSION = 2.0
-INCLUDES = $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
+INCLUDES = $(PYTHON_INCLUDES) $(GLIB_CFLAGS) -DPY_SSIZE_T_CLEAN
pkgincludedir = $(includedir)/pygtk-$(PLATFORM_VERSION)
pkginclude_HEADERS = pygobject.h
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/Makefile.in new/pygobject-2.12.2/gobject/Makefile.in
--- old/pygobject-2.12.1/gobject/Makefile.in 2006-09-04 22:47:38.000000000 +0200
+++ new/pygobject-2.12.2/gobject/Makefile.in 2006-10-03 22:25:28.000000000 +0200
@@ -223,7 +223,7 @@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = 1.7
PLATFORM_VERSION = 2.0
-INCLUDES = $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
+INCLUDES = $(PYTHON_INCLUDES) $(GLIB_CFLAGS) -DPY_SSIZE_T_CLEAN
pkginclude_HEADERS = pygobject.h
# gobject python scripts
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/gobjectmodule.c new/pygobject-2.12.2/gobject/gobjectmodule.c
--- old/pygobject-2.12.1/gobject/gobjectmodule.c 2006-08-28 23:08:28.000000000 +0200
+++ new/pygobject-2.12.2/gobject/gobjectmodule.c 2006-10-03 16:03:43.000000000 +0200
@@ -631,7 +631,7 @@
{
gboolean ret = TRUE;
GObjectClass *oclass;
- int pos = 0;
+ Py_ssize_t pos = 0;
PyObject *key, *value, *overridden_signals = NULL;
overridden_signals = PyDict_New();
@@ -947,7 +947,7 @@
{
gboolean ret = TRUE;
GObjectClass *oclass;
- int pos = 0;
+ Py_ssize_t pos = 0;
PyObject *key, *value;
oclass = g_type_class_ref(instance_type);
@@ -1442,7 +1442,7 @@
PyObject *py_return_type, *py_param_types;
GType instance_type = 0;
- guint n_params, i;
+ Py_ssize_t n_params, i;
GType *param_types;
guint signal_id;
@@ -1830,7 +1830,7 @@
}
if (kwargs) {
- int pos = 0;
+ Py_ssize_t pos = 0;
PyObject *key;
PyObject *value;
@@ -1886,7 +1886,7 @@
static gint
get_handler_priority(gint *priority, PyObject *kwargs)
{
- gint len, pos;
+ Py_ssize_t len, pos;
PyObject *key, *val;
/* no keyword args? leave as default */
@@ -2073,7 +2073,8 @@
pyg_io_add_watch(PyObject *self, PyObject *args, PyObject *kwargs)
{
PyObject *first, *pyfd, *callback, *cbargs = NULL, *data;
- gint fd, priority = G_PRIORITY_DEFAULT, condition, len;
+ gint fd, priority = G_PRIORITY_DEFAULT, condition;
+ Py_ssize_t len;
GIOChannel *iochannel;
guint handler_id;
@@ -2375,7 +2376,7 @@
struct _PyGChildSetupData *callback_data = NULL;
GError *error = NULL;
GPid child_pid = -1;
- int len, i;
+ Py_ssize_t len, i;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|OsiOOOOO:gobject.spawn_async",
kwlist,
@@ -2603,7 +2604,8 @@
PyObject *first, *callback, *extra_args, *data;
gchar *name;
gulong hook_id;
- guint sigid, len;
+ guint sigid;
+ Py_ssize_t len;
GQuark detail = 0;
GType gtype;
PyObject *pygtype;
@@ -2649,8 +2651,7 @@
data,
(GDestroyNotify)pyg_destroy_notify);
- Py_DECREF(extra_args);
- return PyInt_FromLong(hook_id);
+ return PyLong_FromUnsignedLong(hook_id);
}
static PyObject *
@@ -2662,7 +2663,7 @@
gulong hook_id;
GType gtype;
- if (!PyArg_ParseTuple(args, "Osi:gobject.remove_emission_hook",
+ if (!PyArg_ParseTuple(args, "Osk:gobject.remove_emission_hook",
&pygtype, &name, &hook_id))
return NULL;
@@ -2731,7 +2732,7 @@
pyg_filename_from_utf8(PyGObject *self, PyObject *args)
{
char *filename, *utf8string;
- int utf8string_len;
+ Py_ssize_t utf8string_len;
gsize bytes_written;
GError *error = NULL;
PyObject *py_filename;
@@ -2996,7 +2997,7 @@
static int
_pyg_strv_to_gvalue(GValue *value, PyObject *obj)
{
- int argc, i;
+ Py_ssize_t argc, i;
gchar **argv;
if (!(PyTuple_Check(obj) || PyList_Check(obj)))
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/pygenum.c new/pygobject-2.12.2/gobject/pygenum.c
--- old/pygobject-2.12.1/gobject/pygenum.c 2006-08-04 20:41:15.000000000 +0200
+++ new/pygobject-2.12.2/gobject/pygenum.c 2006-10-03 16:03:43.000000000 +0200
@@ -47,7 +47,7 @@
pyg_enum_repr(PyGEnum *self)
{
GEnumClass *enum_class;
- char *value;
+ const char *value;
guint index;
static char tmp[256];
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/pygiochannel.c new/pygobject-2.12.2/gobject/pygiochannel.c
--- old/pygobject-2.12.1/gobject/pygiochannel.c 2006-07-25 18:10:19.000000000 +0200
+++ new/pygobject-2.12.2/gobject/pygiochannel.c 2006-10-03 16:03:43.000000000 +0200
@@ -255,7 +255,7 @@
{
static char *kwlist[] = { "buf", NULL };
const char* buf;
- int buf_len;
+ Py_ssize_t buf_len;
gsize count;
GError* error = NULL;
GIOStatus status;
@@ -278,7 +278,7 @@
{
static char *kwlist[] = { "lines", NULL };
char *buf;
- int buf_len;
+ Py_ssize_t buf_len;
gsize count;
GError* error = NULL;
GIOStatus status;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/pygmainloop.c new/pygobject-2.12.2/gobject/pygmainloop.c
--- old/pygobject-2.12.1/gobject/pygmainloop.c 2006-01-09 13:19:37.000000000 +0100
+++ new/pygobject-2.12.2/gobject/pygmainloop.c 2006-09-06 17:49:44.000000000 +0200
@@ -117,7 +117,7 @@
#ifndef PLATFORM_WIN32
if (pyg_threads_enabled)
#endif
- *timeout = 100;
+ *timeout = 1000;
return FALSE;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/pygobject-private.h new/pygobject-2.12.2/gobject/pygobject-private.h
--- old/pygobject-2.12.1/gobject/pygobject-private.h 2006-08-17 17:51:36.000000000 +0200
+++ new/pygobject-2.12.2/gobject/pygobject-private.h 2006-10-03 19:28:26.000000000 +0200
@@ -20,6 +20,14 @@
} while (0)
#endif
+#if PY_VERSION_HEX < 0x02050000
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+typedef inquiry lenfunc;
+#endif
+
+
/* from gobjectmodule.c */
extern struct _PyGObject_Functions pygobject_api_functions;
#define pyg_block_threads() G_STMT_START { \
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/pygobject.c new/pygobject-2.12.2/gobject/pygobject.c
--- old/pygobject-2.12.1/gobject/pygobject.c 2006-08-04 20:41:15.000000000 +0200
+++ new/pygobject-2.12.2/gobject/pygobject.c 2006-10-03 16:03:44.000000000 +0200
@@ -338,7 +338,7 @@
return (PyObject *) iter;
}
-static int
+static Py_ssize_t
PyGProps_length(PyGProps *self)
{
GObjectClass *class;
@@ -348,17 +348,17 @@
g_object_class_list_properties(class, &n_props);
g_type_class_unref(class);
- return (int)n_props;
+ return (Py_ssize_t)n_props;
}
static PySequenceMethods _PyGProps_as_sequence = {
- (inquiry)PyGProps_length,
- (binaryfunc)0,
- (intargfunc)0,
- (intargfunc)0,
- (intintargfunc)0,
- (intobjargproc)0,
- (intintobjargproc)0
+ (lenfunc) PyGProps_length,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
};
PyTypeObject PyGProps_Type = {
@@ -1010,7 +1010,7 @@
}
if (kwargs) {
- int pos = 0;
+ Py_ssize_t pos = 0;
PyObject *key;
PyObject *value;
@@ -1215,7 +1215,8 @@
{
PyObject *first, *callback, *extra_args;
gchar *name;
- guint handlerid, sigid, len;
+ guint sigid, len;
+ gulong handlerid;
GQuark detail = 0;
GClosure *closure;
@@ -1253,7 +1254,7 @@
handlerid = g_signal_connect_closure_by_id(self->obj, sigid, detail,
closure, FALSE);
Py_DECREF(extra_args);
- return PyInt_FromLong(handlerid);
+ return PyLong_FromUnsignedLong(handlerid);
}
static PyObject *
@@ -1261,7 +1262,9 @@
{
PyObject *first, *callback, *extra_args;
gchar *name;
- guint handlerid, sigid, len;
+ guint sigid;
+ gulong handlerid;
+ Py_ssize_t len;
GQuark detail;
GClosure *closure;
@@ -1300,7 +1303,7 @@
handlerid = g_signal_connect_closure_by_id(self->obj, sigid, detail,
closure, TRUE);
Py_DECREF(extra_args);
- return PyInt_FromLong(handlerid);
+ return PyLong_FromUnsignedLong(handlerid);
}
static PyObject *
@@ -1308,7 +1311,9 @@
{
PyObject *first, *callback, *extra_args, *object;
gchar *name;
- guint handlerid, sigid, len;
+ guint sigid;
+ gulong handlerid;
+ Py_ssize_t len;
GQuark detail;
GClosure *closure;
@@ -1347,7 +1352,7 @@
handlerid = g_signal_connect_closure_by_id(self->obj, sigid, detail,
closure, FALSE);
Py_DECREF(extra_args);
- return PyInt_FromLong(handlerid);
+ return PyLong_FromUnsignedLong(handlerid);
}
static PyObject *
@@ -1355,7 +1360,9 @@
{
PyObject *first, *callback, *extra_args, *object;
gchar *name;
- guint handlerid, sigid, len;
+ guint sigid;
+ gulong handlerid;
+ Py_ssize_t len;
GQuark detail;
GClosure *closure;
@@ -1394,15 +1401,15 @@
handlerid = g_signal_connect_closure_by_id(self->obj, sigid, detail,
closure, TRUE);
Py_DECREF(extra_args);
- return PyInt_FromLong(handlerid);
+ return PyLong_FromUnsignedLong(handlerid);
}
static PyObject *
pygobject_disconnect(PyGObject *self, PyObject *args)
{
- guint handler_id;
+ gulong handler_id;
- if (!PyArg_ParseTuple(args, "i:GObject.disconnect", &handler_id))
+ if (!PyArg_ParseTuple(args, "k:GObject.disconnect", &handler_id))
return NULL;
CHECK_GOBJECT(self);
@@ -1415,9 +1422,9 @@
static PyObject *
pygobject_handler_is_connected(PyGObject *self, PyObject *args)
{
- guint handler_id;
+ gulong handler_id;
- if (!PyArg_ParseTuple(args, "i:GObject.handler_is_connected", &handler_id))
+ if (!PyArg_ParseTuple(args, "k:GObject.handler_is_connected", &handler_id))
return NULL;
@@ -1429,9 +1436,9 @@
static PyObject *
pygobject_handler_block(PyGObject *self, PyObject *args)
{
- guint handler_id;
+ gulong handler_id;
- if (!PyArg_ParseTuple(args, "i:GObject.handler_block", &handler_id))
+ if (!PyArg_ParseTuple(args, "k:GObject.handler_block", &handler_id))
return NULL;
CHECK_GOBJECT(self);
@@ -1444,9 +1451,9 @@
static PyObject *
pygobject_handler_unblock(PyGObject *self, PyObject *args)
{
- guint handler_id;
+ gulong handler_id;
- if (!PyArg_ParseTuple(args, "i:GObject.handler_unblock", &handler_id))
+ if (!PyArg_ParseTuple(args, "k:GObject.handler_unblock", &handler_id))
return NULL;
g_signal_handler_unblock(self->obj, handler_id);
Py_INCREF(Py_None);
@@ -1456,7 +1463,8 @@
static PyObject *
pygobject_emit(PyGObject *self, PyObject *args)
{
- guint signal_id, i, len;
+ guint signal_id, i;
+ Py_ssize_t len;
GQuark detail;
PyObject *first, *py_ret;
gchar *name;
@@ -1489,7 +1497,7 @@
gchar buf[128];
g_snprintf(buf, sizeof(buf),
- "%d parameters needed for signal %s; %d given",
+ "%d parameters needed for signal %s; %ld given",
query.n_params, name, len - 1);
PyErr_SetString(PyExc_TypeError, buf);
return NULL;
@@ -1569,7 +1577,8 @@
pygobject_chain_from_overridden(PyGObject *self, PyObject *args)
{
GSignalInvocationHint *ihint;
- guint signal_id, i, len;
+ guint signal_id, i;
+ Py_ssize_t len;
PyObject *py_ret;
const gchar *name;
GSignalQuery query;
@@ -1597,7 +1606,7 @@
gchar buf[128];
g_snprintf(buf, sizeof(buf),
- "%d parameters needed for signal %s; %d given",
+ "%d parameters needed for signal %s; %ld given",
query.n_params, name, len);
PyErr_SetString(PyExc_TypeError, buf);
return NULL;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/pygobject.h new/pygobject-2.12.2/gobject/pygobject.h
--- old/pygobject-2.12.1/gobject/pygobject.h 2006-09-05 01:09:23.000000000 +0200
+++ new/pygobject-2.12.2/gobject/pygobject.h 2006-09-25 14:53:12.000000000 +0200
@@ -294,11 +294,12 @@
} G_STMT_END
#define init_pygobject_check(req_major, req_minor, req_micro) G_STMT_START { \
- init_pygobject(); \
- PyObject *gobject = PyImport_ImportModule("gobject"); \
- PyObject *mdict = PyModule_GetDict(gobject); \
- PyObject *version = PyDict_GetItemString(mdict, "pygobject_version"); \
+ PyObject *gobject, *mdict, *version; \
int found_major, found_minor, found_micro; \
+ init_pygobject(); \
+ gobject = PyImport_ImportModule("gobject"); \
+ mdict = PyModule_GetDict(gobject); \
+ version = PyDict_GetItemString(mdict, "pygobject_version"); \
if (!version) \
version = PyDict_GetItemString(mdict, "pygtk_version"); \
if (!version) { \
@@ -311,7 +312,7 @@
return; \
if (req_major != found_major || \
req_minor > found_minor || \
- req_minor == found_minor && req_micro > found_micro) { \
+ (req_minor == found_minor && req_micro > found_micro)) { \
PyErr_Format(PyExc_ImportError, \
"PyGObject version mismatch, %d.%d.%d is required, " \
"found %d.%d.%d.", req_major, req_minor, req_micro, \
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/pygoptioncontext.c new/pygobject-2.12.2/gobject/pygoptioncontext.c
--- old/pygobject-2.12.1/gobject/pygoptioncontext.c 2006-07-13 16:18:37.000000000 +0200
+++ new/pygobject-2.12.2/gobject/pygoptioncontext.c 2006-10-03 16:03:44.000000000 +0200
@@ -63,7 +63,8 @@
static char *kwlist[] = { "argv", NULL };
PyObject *arg;
PyObject *new_argv, *argv;
- gssize argv_length, pos;
+ Py_ssize_t argv_length, pos;
+ gint argv_length_int;
char **argv_content, **original;
GError *error = NULL;
gboolean result;
@@ -100,11 +101,14 @@
}
}
original = g_strdupv(argv_content);
-
+
+ g_assert(argv_length <= G_MAXINT);
+ argv_length_int = argv_length;
pyg_begin_allow_threads;
- result = g_option_context_parse(self->context, &argv_length, &argv_content,
+ result = g_option_context_parse(self->context, &argv_length_int, &argv_content,
&error);
pyg_end_allow_threads;
+ argv_length = argv_length_int;
if (!result)
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/gobject/pygtype.c new/pygobject-2.12.2/gobject/pygtype.c
--- old/pygobject-2.12.1/gobject/pygtype.c 2006-07-13 18:08:13.000000000 +0200
+++ new/pygobject-2.12.2/gobject/pygtype.c 2006-10-03 16:03:44.000000000 +0200
@@ -859,7 +859,7 @@
G_VALUE_HOLDS(value, G_TYPE_GSTRING)) {
GString *string;
char *buffer;
- int len;
+ Py_ssize_t len;
if (PyString_AsStringAndSize(obj, &buffer, &len))
return -1;
string = g_string_new_len(buffer, len);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/pygtk.py new/pygobject-2.12.2/pygtk.py
--- old/pygobject-2.12.1/pygtk.py 2006-05-06 16:26:09.000000000 +0200
+++ new/pygobject-2.12.2/pygtk.py 2006-09-29 15:17:14.000000000 +0200
@@ -4,18 +4,18 @@
#
# pygtk.py: pygtk version selection code.
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This library is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
+# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Lesser General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/setup.py new/pygobject-2.12.2/setup.py
--- old/pygobject-2.12.1/setup.py 2006-07-07 22:58:34.000000000 +0200
+++ new/pygobject-2.12.2/setup.py 2006-09-25 14:53:57.000000000 +0200
@@ -6,6 +6,7 @@
from distutils.command.build import build
from distutils.core import setup
+import glob
import os
import sys
@@ -48,12 +49,14 @@
('PYGOBJECT_MINOR_VERSION', MINOR_VERSION),
('PYGOBJECT_MICRO_VERSION', MICRO_VERSION)]
-if sys.platform == 'win32':
- GLOBAL_MACROS.append(('VERSION', '\\\"%s\\\"' % VERSION))
+if sys.platform == 'win33':
+ GLOBAL_MACROS.append(('VERSION', '"""%s"""' % VERSION))
else:
GLOBAL_MACROS.append(('VERSION', '"%s"' % VERSION))
INCLUDE_DIR = os.path.join('include', 'pygtk-%s' % PYGOBJECT_SUFFIX)
+XSL_DIR = os.path.join('share', 'pygobject','xsl')
+HTML_DIR = os.path.join('share', 'gtk-doc', 'html', 'pygobject')
class PyGObjectInstallLib(InstallLib):
def run(self):
@@ -98,6 +101,8 @@
self.install_template('pygobject-2.0.pc.in',
os.path.join(self.install_dir,
'lib', 'pkgconfig'))
+ self.install_template('docs/xsl/fixxref.py.in',
+ os.path.join(self.install_dir, XSL_DIR))
class PyGObjectBuild(build):
enable_threading = 1
@@ -128,7 +133,6 @@
ext_modules = []
py_modules = []
py_modules.append('dsextras')
-py_modules.append('gobject.option')
if not have_pkgconfig():
print "Error, could not find pkg-config"
@@ -136,7 +140,11 @@
if gobject.can_build():
ext_modules.append(gobject)
+ py_modules.append('gobject.option')
data_files.append((INCLUDE_DIR, ('gobject/pygobject.h',)))
+ data_files.append((HTML_DIR, glob.glob('docs/html/*.html')))
+ data_files.append((HTML_DIR, ['docs/style.css']))
+ data_files.append((XSL_DIR, glob.glob('docs/xsl/*.xsl')))
else:
print
print 'ERROR: Nothing to do, gobject could not be found and is essential.'
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pygobject-2.12.1/tests/test_signal.py new/pygobject-2.12.2/tests/test_signal.py
--- old/pygobject-2.12.1/tests/test_signal.py 2006-08-28 23:08:29.000000000 +0200
+++ new/pygobject-2.12.2/tests/test_signal.py 2006-09-25 14:53:13.000000000 +0200
@@ -139,6 +139,16 @@
assert self.status == 0
self.status = 1
+class F(gobject.GObject):
+ __gsignals__ = { 'signal': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ ()) }
+ def __init__(self):
+ gobject.GObject.__init__(self)
+ self.status = 0
+
+ def do_signal(self):
+ self.status += 1
+
class TestEmissionHook(unittest.TestCase):
def testAdd(self):
self.hook = True
@@ -168,6 +178,41 @@
self.assertEqual(e.status, 1)
e.status = 3
+ def testCallbackReturnFalse(self):
+ self.hook = False
+ obj = F()
+ def _emission_hook(obj):
+ obj.status += 1
+ return False
+ hook_id = gobject.add_emission_hook(obj, "signal", _emission_hook)
+ obj.emit('signal')
+ obj.emit('signal')
+ self.assertEqual(obj.status, 3)
+
+ def testCallbackReturnTrue(self):
+ self.hook = False
+ obj = F()
+ def _emission_hook(obj):
+ obj.status += 1
+ return True
+ hook_id = gobject.add_emission_hook(obj, "signal", _emission_hook)
+ obj.emit('signal')
+ obj.emit('signal')
+ gobject.remove_emission_hook(obj, "signal", hook_id)
+ self.assertEqual(obj.status, 4)
+
+ def testCallbackReturnTrueButRemove(self):
+ self.hook = False
+ obj = F()
+ def _emission_hook(obj):
+ obj.status += 1
+ return True
+ hook_id = gobject.add_emission_hook(obj, "signal", _emission_hook)
+ obj.emit('signal')
+ gobject.remove_emission_hook(obj, "signal", hook_id)
+ obj.emit('signal')
+ self.assertEqual(obj.status, 3)
+
class TestClosures(unittest.TestCase):
def setUp(self):
self.count = 0
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org