r28841 - in /desktop/unstable/pygobject/debian: changelog patches/00git_gio_test.patch patches/00git_messagebox_type.patch patches/00git_python3-maketrans.patch patches/00git_python3_build.patch patches/series

mpitt at users.alioth.debian.org mpitt at users.alioth.debian.org
Wed Jul 13 09:07:30 UTC 2011


Author: mpitt
Date: Wed Jul 13 09:07:29 2011
New Revision: 28841

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=28841
Log:
cherrypick more fixes from pygobject-2-28 upstream branch, mostly to fix operation with Python 3

Added:
    desktop/unstable/pygobject/debian/patches/00git_gio_test.patch
    desktop/unstable/pygobject/debian/patches/00git_messagebox_type.patch
    desktop/unstable/pygobject/debian/patches/00git_python3-maketrans.patch
    desktop/unstable/pygobject/debian/patches/00git_python3_build.patch
Modified:
    desktop/unstable/pygobject/debian/changelog
    desktop/unstable/pygobject/debian/patches/series

Modified: desktop/unstable/pygobject/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/changelog?rev=28841&op=diff
==============================================================================
--- desktop/unstable/pygobject/debian/changelog [utf-8] (original)
+++ desktop/unstable/pygobject/debian/changelog [utf-8] Wed Jul 13 09:07:29 2011
@@ -1,8 +1,13 @@
 pygobject (2.28.6-3) UNRELEASED; urgency=low
 
-  * Add 00git_test_case_hang.patch: Fix hang in test suite when
-    TestGDBusClient.test_native_calls_async() test case fails. (Cherrypicked
-    from upstream pygobject-2-28 branch.)
+  * Cherrypick some fixes from pygobject-2-28 upstream branch:
+    - 00git_test_case_hang.patch: Fix hang in test suite when
+      TestGDBusClient.test_native_calls_async() test case fails.
+    - 00git_messagebox_type.patch: Fix MessageBox so it correctly handles
+      the type constructor param.
+    - 00git_python3_build.patch, 00git_python3-maketrans.patch: Python 3 fixes.
+    - 00git_gio_test.patch: Port test_properties from static gio to GI Gio, so
+      that the tests will also work with Python 3.
 
  -- Martin Pitt <mpitt at debian.org>  Wed, 13 Jul 2011 08:21:03 +0200
 

Added: desktop/unstable/pygobject/debian/patches/00git_gio_test.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/patches/00git_gio_test.patch?rev=28841&op=file
==============================================================================
--- desktop/unstable/pygobject/debian/patches/00git_gio_test.patch (added)
+++ desktop/unstable/pygobject/debian/patches/00git_gio_test.patch [utf-8] Wed Jul 13 09:07:29 2011
@@ -1,0 +1,85 @@
+From 5c2786804d997df680131542b4afb31e2db3a2cb Mon Sep 17 00:00:00 2001
+From: Martin Pitt <martin.pitt at ubuntu.com>
+Date: Wed, 13 Jul 2011 10:40:25 +0200
+Subject: [PATCH 4/4] [gi] Port test_properties from static gio to GI Gio
+
+As we ripped out the static gio bindings a while ago, this test case was using
+the system installed gio bindings with Python 2, and now fails completely with
+Python 3. Rewrite it to use gi.repository.Gio.
+---
+ tests/test_properties.py |   38 +++++++++++++++++++-------------------
+ 1 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/tests/test_properties.py b/tests/test_properties.py
+index 74c1b38..3930671 100644
+--- a/tests/test_properties.py
++++ b/tests/test_properties.py
+@@ -14,7 +14,7 @@ from gobject.constants import \
+      G_MININT, G_MAXINT, G_MAXUINT, G_MINLONG, G_MAXLONG, \
+      G_MAXULONG
+ 
+-import gio
++from gi.repository import Gio
+ 
+ if sys.version_info < (3, 0):
+     TEST_UTF8 = "\xe2\x99\xa5"
+@@ -37,7 +37,7 @@ class PropertyObject(GObject):
+         type=TYPE_UINT64, flags=PARAM_READWRITE|PARAM_CONSTRUCT)
+ 
+     enum = gobject.property(
+-        type=gio.SocketType, default=gio.SOCKET_TYPE_STREAM)
++        type=Gio.SocketType, default=Gio.SocketType.STREAM)
+ 
+ class TestProperties(unittest.TestCase):
+     def testGetSet(self):
+@@ -135,30 +135,30 @@ class TestProperties(unittest.TestCase):
+ 
+     def testEnum(self):
+         obj = new(PropertyObject)
+-        self.assertEqual(obj.props.enum, gio.SOCKET_TYPE_STREAM)
+-        self.assertEqual(obj.enum, gio.SOCKET_TYPE_STREAM)
+-        obj.enum = gio.SOCKET_TYPE_DATAGRAM
+-        self.assertEqual(obj.props.enum, gio.SOCKET_TYPE_DATAGRAM)
+-        self.assertEqual(obj.enum, gio.SOCKET_TYPE_DATAGRAM)
+-        obj.props.enum = gio.SOCKET_TYPE_STREAM
+-        self.assertEqual(obj.props.enum, gio.SOCKET_TYPE_STREAM)
+-        self.assertEqual(obj.enum, gio.SOCKET_TYPE_STREAM)
++        self.assertEqual(obj.props.enum, Gio.SocketType.STREAM)
++        self.assertEqual(obj.enum, Gio.SocketType.STREAM)
++        obj.enum = Gio.SocketType.DATAGRAM
++        self.assertEqual(obj.props.enum, Gio.SocketType.DATAGRAM)
++        self.assertEqual(obj.enum, Gio.SocketType.DATAGRAM)
++        obj.props.enum = Gio.SocketType.STREAM
++        self.assertEqual(obj.props.enum, Gio.SocketType.STREAM)
++        self.assertEqual(obj.enum, Gio.SocketType.STREAM)
+         obj.props.enum = 2
+-        self.assertEqual(obj.props.enum, gio.SOCKET_TYPE_DATAGRAM)
+-        self.assertEqual(obj.enum, gio.SOCKET_TYPE_DATAGRAM)
++        self.assertEqual(obj.props.enum, Gio.SocketType.DATAGRAM)
++        self.assertEqual(obj.enum, Gio.SocketType.DATAGRAM)
+         obj.enum = 1
+-        self.assertEqual(obj.props.enum, gio.SOCKET_TYPE_STREAM)
+-        self.assertEqual(obj.enum, gio.SOCKET_TYPE_STREAM)
++        self.assertEqual(obj.props.enum, Gio.SocketType.STREAM)
++        self.assertEqual(obj.enum, Gio.SocketType.STREAM)
+ 
+         self.assertRaises(TypeError, setattr, obj, 'enum', 'foo')
+         self.assertRaises(TypeError, setattr, obj, 'enum', object())
+ 
+-        self.assertRaises(TypeError, gobject.property, type=gio.SocketType)
+-        self.assertRaises(TypeError, gobject.property, type=gio.SocketType,
+-                          default=gio.SOCKET_PROTOCOL_TCP)
+-        self.assertRaises(TypeError, gobject.property, type=gio.SocketType,
++        self.assertRaises(TypeError, gobject.property, type=Gio.SocketType)
++        self.assertRaises(TypeError, gobject.property, type=Gio.SocketType,
++                          default=Gio.SocketProtocol.TCP)
++        self.assertRaises(TypeError, gobject.property, type=Gio.SocketType,
+                           default=object())
+-        self.assertRaises(TypeError, gobject.property, type=gio.SocketType,
++        self.assertRaises(TypeError, gobject.property, type=Gio.SocketType,
+                           default=1)
+ 
+     def testRange(self):
+-- 
+1.7.5.4
+

Added: desktop/unstable/pygobject/debian/patches/00git_messagebox_type.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/patches/00git_messagebox_type.patch?rev=28841&op=file
==============================================================================
--- desktop/unstable/pygobject/debian/patches/00git_messagebox_type.patch (added)
+++ desktop/unstable/pygobject/debian/patches/00git_messagebox_type.patch [utf-8] Wed Jul 13 09:07:29 2011
@@ -1,0 +1,42 @@
+From 483a894681ef0080107b33733f392911d4a65b76 Mon Sep 17 00:00:00 2001
+From: "John (J5) Palmieri" <johnp at redhat.com>
+Date: Fri, 8 Jul 2011 11:50:17 -0400
+Subject: [PATCH 1/4] [gi-overrides] fix MessageBox so it correctly handles
+ the type constructor param
+
+---
+ gi/overrides/Gtk.py |   10 ++++++++--
+ 1 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
+index 007e155..1408f47 100644
+--- a/gi/overrides/Gtk.py
++++ b/gi/overrides/Gtk.py
+@@ -413,16 +413,22 @@ class MessageDialog(Gtk.MessageDialog, Dialog):
+     def __init__(self,
+                  parent=None,
+                  flags=0,
+-                 type=Gtk.MessageType.INFO,
++                 message_type=Gtk.MessageType.INFO,
+                  buttons=Gtk.ButtonsType.NONE,
+                  message_format=None,
+                  **kwds):
+ 
+         if message_format != None:
+             kwds['text'] = message_format
++
++        if 'type' in kwds:
++            import warnings
++            warnings.warn("The use of the keyword type as a parameter of the Gtk.MessageDialog constructor has been depricated. Please use message_type instead.", DeprecationWarning)
++            message_type = kwds['type']
++
+         Gtk.MessageDialog.__init__(self,
+                                    _buttons_property=buttons,
+-                                   message_type=type,
++                                   message_type=message_type,
+                                    **kwds)
+         Dialog.__init__(self, parent=parent, flags=flags)
+ 
+-- 
+1.7.5.4
+

Added: desktop/unstable/pygobject/debian/patches/00git_python3-maketrans.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/patches/00git_python3-maketrans.patch?rev=28841&op=file
==============================================================================
--- desktop/unstable/pygobject/debian/patches/00git_python3-maketrans.patch (added)
+++ desktop/unstable/pygobject/debian/patches/00git_python3-maketrans.patch [utf-8] Wed Jul 13 09:07:29 2011
@@ -1,0 +1,40 @@
+From 667bec76ccbc85cc1d54a0e68977dbda241c028c Mon Sep 17 00:00:00 2001
+From: Martin Pitt <martin.pitt at ubuntu.com>
+Date: Wed, 13 Jul 2011 08:42:22 +0200
+Subject: [PATCH 2/4] [python3] Fix maketrans import
+
+Python3 moved the maketrans() function from the string module to a str method.
+This unbreaks gi/module.py for Python 3 again.
+---
+ gi/module.py |    8 ++++++--
+ 1 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/gi/module.py b/gi/module.py
+index 70df76c..d56bdaf 100644
+--- a/gi/module.py
++++ b/gi/module.py
+@@ -24,7 +24,11 @@ from __future__ import absolute_import
+ 
+ import os
+ import gobject
+-import string
++try:
++    maketrans = ''.maketrans
++except AttributeError:
++    # fallback for Python 2
++    from string import maketrans
+ 
+ import gi
+ from .overrides import registry
+@@ -124,7 +128,7 @@ class IntrospectionModule(object):
+                 # Don't use upper() here to avoid locale specific
+                 # identifier conversion (e. g. in Turkish 'i'.upper() == 'i')
+                 # see https://bugzilla.gnome.org/show_bug.cgi?id=649165
+-                ascii_upper_trans = string.maketrans(
++                ascii_upper_trans = maketrans(
+                         'abcdefgjhijklmnopqrstuvwxyz', 
+                         'ABCDEFGJHIJKLMNOPQRSTUVWXYZ')
+                 for value_info in info.get_values():
+-- 
+1.7.5.4
+

Added: desktop/unstable/pygobject/debian/patches/00git_python3_build.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/patches/00git_python3_build.patch?rev=28841&op=file
==============================================================================
--- desktop/unstable/pygobject/debian/patches/00git_python3_build.patch (added)
+++ desktop/unstable/pygobject/debian/patches/00git_python3_build.patch [utf-8] Wed Jul 13 09:07:29 2011
@@ -1,0 +1,39 @@
+From e2dc4ac346a16b6976b92e84819c7203629beb4a Mon Sep 17 00:00:00 2001
+From: Ignacio Casal Quinteiro <icq at gnome.org>
+Date: Thu, 21 Apr 2011 16:52:20 +0200
+Subject: [PATCH 3/4] [python3] fix build. PYcairo_IMPORT doesn't exists
+ anymore
+
+---
+ gi/pygi-foreign-cairo.c |    7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/gi/pygi-foreign-cairo.c b/gi/pygi-foreign-cairo.c
+index 81b9865..edf52d7 100644
+--- a/gi/pygi-foreign-cairo.c
++++ b/gi/pygi-foreign-cairo.c
+@@ -30,7 +30,7 @@
+ #include <pycairo/py3cairo.h>
+ #endif
+ 
+-Pycairo_CAPI_t *Pycairo_CAPI;
++static Pycairo_CAPI_t *Pycairo_CAPI;
+ 
+ #include "pygi-foreign.h"
+ 
+@@ -117,7 +117,12 @@ cairo_surface_release (GIBaseInfo *base_info,
+ static PyMethodDef _gi_cairo_functions[] = {0,};
+ PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo")
+ {
++#if PY_VERSION_HEX < 0x03000000
+     Pycairo_IMPORT;
++#else
++    Pycairo_CAPI = (Pycairo_CAPI_t*) PyCObject_Import("cairo", "CAPI");
++#endif
++
+     if (Pycairo_CAPI == NULL)
+         return PYGLIB_MODULE_ERROR_RETURN;
+ 
+-- 
+1.7.5.4
+

Modified: desktop/unstable/pygobject/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/patches/series?rev=28841&op=diff
==============================================================================
--- desktop/unstable/pygobject/debian/patches/series [utf-8] (original)
+++ desktop/unstable/pygobject/debian/patches/series [utf-8] Wed Jul 13 09:07:29 2011
@@ -2,4 +2,8 @@
 00git_cairo_init.patch
 00git_textiter_crash.patch
 00git_test_case_hang.patch
+00git_gio_test.patch
+00git_messagebox_type.patch
+00git_python3_build.patch
+00git_python3-maketrans.patch
 20_deprecated_spam.patch




More information about the pkg-gnome-commits mailing list