Gentoo Archives: gentoo-commits

From: "Alexandre Rostovtsev (tetromino)" <tetromino@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/pygobject/files: pygobject-3.0.3-gobject-property-min-max.patch pygobject-3.0.3-disable-new-gi-tests.patch pygobject-3.0.3-tests-python3.patch
Date: Mon, 26 Dec 2011 06:30:07
Message-Id: 20111226062955.C6E9A2001D@flycatcher.gentoo.org
1 tetromino 11/12/26 06:29:55
2
3 Added: pygobject-3.0.3-gobject-property-min-max.patch
4 pygobject-3.0.3-disable-new-gi-tests.patch
5 pygobject-3.0.3-tests-python3.patch
6 Log:
7 Version bump with assorted bugfixes. Fix example installation directory (bug #392449 comment 3, thanks to Arfrever). Also, restrict pypy for all versions of pygobject and improve use of python eclass in 3.0.3 (bug #321879 comment 8, thanks to Arfrever).
8
9 (Portage version: 2.2.0_alpha83/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.1 dev-python/pygobject/files/pygobject-3.0.3-gobject-property-min-max.patch
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pygobject/files/pygobject-3.0.3-gobject-property-min-max.patch?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pygobject/files/pygobject-3.0.3-gobject-property-min-max.patch?rev=1.1&content-type=text/plain
16
17 Index: pygobject-3.0.3-gobject-property-min-max.patch
18 ===================================================================
19 From 00030bc6f0fb961c716ed692144cd8e4bb9be7d0 Mon Sep 17 00:00:00 2001
20 From: =?UTF-8?q?Sebastian=20P=C3=B6lsterl?= <sebp@×××××.org>
21 Date: Sat, 10 Dec 2011 12:51:45 +0100
22 Subject: [PATCH] Fixed bug where GObject.property did not respect minimum and
23 maximum values
24
25 https://bugzilla.gnome.org/show_bug.cgi?id=664864
26 ---
27 gi/_gobject/propertyhelper.py | 2 +-
28 tests/test_properties.py | 31 +++++++++++++++++++++++++++++++
29 2 files changed, 32 insertions(+), 1 deletions(-)
30
31 diff --git a/gi/_gobject/propertyhelper.py b/gi/_gobject/propertyhelper.py
32 index 4635350..9208a0b 100644
33 --- a/gi/_gobject/propertyhelper.py
34 +++ b/gi/_gobject/propertyhelper.py
35 @@ -298,7 +298,7 @@ class property(object):
36 ptype = self.type
37 if ptype in [TYPE_INT, TYPE_UINT, TYPE_LONG, TYPE_ULONG,
38 TYPE_INT64, TYPE_UINT64, TYPE_FLOAT, TYPE_DOUBLE]:
39 - args = self._get_minimum(), self._get_maximum(), self.default
40 + args = self.minimum, self.maximum, self.default
41 elif (ptype == TYPE_STRING or ptype == TYPE_BOOLEAN or
42 ptype.is_a(TYPE_ENUM)):
43 args = (self.default,)
44 diff --git a/tests/test_properties.py b/tests/test_properties.py
45 index 3521647..75aacff 100644
46 --- a/tests/test_properties.py
47 +++ b/tests/test_properties.py
48 @@ -367,6 +367,37 @@ class TestProperty(unittest.TestCase):
49 GObject.property, type=gtype, minimum=min,
50 maximum=max+1)
51
52 + def testMinMax(self):
53 + class C(GObject.GObject):
54 + prop_int = GObject.property(type=int, minimum=1, maximum=100, default=1)
55 + prop_float = GObject.property(type=float, minimum=0.1, maximum=10.5, default=1.1)
56 +
57 + def __init__(self):
58 + GObject.GObject.__init__(self)
59 +
60 + o = C()
61 + self.assertEqual(o.prop_int, 1)
62 +
63 + o.prop_int = 5
64 + self.assertEqual(o.prop_int, 5)
65 +
66 + o.prop_int = 0
67 + self.assertEqual(o.prop_int, 5)
68 +
69 + o.prop_int = 101
70 + self.assertEqual(o.prop_int, 5)
71 +
72 + self.assertEqual(o.prop_float, 1.1)
73 +
74 + o.prop_float = 7.75
75 + self.assertEqual(o.prop_float, 7.75)
76 +
77 + o.prop_float = 0.09
78 + self.assertEqual(o.prop_float, 7.75)
79 +
80 + o.prop_float = 10.51
81 + self.assertEqual(o.prop_float, 7.75)
82 +
83 def testMultipleInstances(self):
84 class C(GObject.GObject):
85 prop = GObject.property(type=str, default='default')
86 --
87 1.7.8.1
88
89
90
91
92 1.1 dev-python/pygobject/files/pygobject-3.0.3-disable-new-gi-tests.patch
93
94 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pygobject/files/pygobject-3.0.3-disable-new-gi-tests.patch?rev=1.1&view=markup
95 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pygobject/files/pygobject-3.0.3-disable-new-gi-tests.patch?rev=1.1&content-type=text/plain
96
97 Index: pygobject-3.0.3-disable-new-gi-tests.patch
98 ===================================================================
99 Disable tests requiring >=gobject-introspection-1.31
100
101 diff --git a/tests/test_everything.py b/tests/test_everything.py
102 index 43735e5..ecfdef4 100644
103 --- a/tests/test_everything.py
104 +++ b/tests/test_everything.py
105 @@ -507,22 +507,3 @@ class TestAdvancedInterfaces(unittest.TestCase):
106 self.assertEquals(ret[0], 51);
107 self.assertEquals(ret[1], 61);
108 self.assertEquals(ret[2], 32);
109 -
110 - def test_obj_skip_return_val_no_out(self):
111 - obj = Everything.TestObj();
112 - # raises an error for 0, succeeds for any other value
113 - self.assertRaises(GLib.GError, obj.skip_return_val_no_out, 0)
114 -
115 - ret = obj.skip_return_val_no_out(1)
116 - self.assertEquals(ret, None)
117 -
118 -class TestSignals(unittest.TestCase):
119 - def test_object_param_signal(self):
120 - obj = Everything.TestObj();
121 -
122 - def callback (obj_param):
123 - self.assertEquals(obj_param.props.int, 3)
124 - self.assertEquals(obj_param.__grefcount__, 2)
125 -
126 - obj.connect('sig-with-obj', callback)
127 - obj.emit_sig_with_obj()
128 diff --git a/tests/test_gi.py b/tests/test_gi.py
129 index 0a9b1b2..7e24778 100644
130 --- a/tests/test_gi.py
131 +++ b/tests/test_gi.py
132 @@ -770,18 +770,6 @@ class TestArray(unittest.TestCase):
133 def test_gstrv_inout(self):
134 self.assertEquals(['-1', '0', '1', '2'], GIMarshallingTests.gstrv_inout(['0', '1', '2']))
135
136 - def test_array_gvariant_none_in(self):
137 - v = [GLib.Variant("i", 27), GLib.Variant("s", "Hello")]
138 - self.assertEquals([27, "Hello"], map(GLib.Variant.unpack, GIMarshallingTests.array_gvariant_none_in(v)))
139 -
140 - def test_array_gvariant_container_in(self):
141 - v = [GLib.Variant("i", 27), GLib.Variant("s", "Hello")]
142 - self.assertEquals([27, "Hello"], map(GLib.Variant.unpack, GIMarshallingTests.array_gvariant_none_in(v)))
143 -
144 - def test_array_gvariant_full_in(self):
145 - v = [GLib.Variant("i", 27), GLib.Variant("s", "Hello")]
146 - self.assertEquals([27, "Hello"], map(GLib.Variant.unpack, GIMarshallingTests.array_gvariant_none_in(v)))
147 -
148 def test_bytearray_gvariant(self):
149 v = GLib.Variant.new_bytestring("foo")
150 self.assertEquals(v.get_bytestring(), "foo")
151 @@ -1651,16 +1639,6 @@ class TestPythonGObject(unittest.TestCase):
152 def do_method_not_a_vfunc(self):
153 pass
154
155 - def test_subsubobject(self):
156 - class SubSubSubObject(GIMarshallingTests.SubSubObject):
157 - def do_method_deep_hierarchy(self, num):
158 - self.props.int = num * 2
159 -
160 - sub_sub_sub_object = SubSubSubObject()
161 - GIMarshallingTests.SubSubObject.do_method_deep_hierarchy(sub_sub_sub_object, 5)
162 - self.assertEqual(sub_sub_sub_object.props.int, 5)
163 -
164 -
165 class TestMultiOutputArgs(unittest.TestCase):
166
167 def test_int_out_out(self):
168
169
170
171 1.1 dev-python/pygobject/files/pygobject-3.0.3-tests-python3.patch
172
173 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pygobject/files/pygobject-3.0.3-tests-python3.patch?rev=1.1&view=markup
174 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pygobject/files/pygobject-3.0.3-tests-python3.patch?rev=1.1&content-type=text/plain
175
176 Index: pygobject-3.0.3-tests-python3.patch
177 ===================================================================
178 From 8d88283688797b8fc70a7cbccd42a71b8518098d Mon Sep 17 00:00:00 2001
179 From: Alexandre Rostovtsev <tetromino@g.o>
180 Date: Mon, 26 Dec 2011 00:44:56 -0500
181 Subject: [PATCH] Fix bytearray test compatibility with python3
182
183 https://bugs.gentoo.org/show_bug.cgi?id=321879
184 ---
185 tests/test_gi.py | 4 ++--
186 1 files changed, 2 insertions(+), 2 deletions(-)
187
188 diff --git a/tests/test_gi.py b/tests/test_gi.py
189 index 0a9b1b2..8726187 100644
190 --- a/tests/test_gi.py
191 +++ b/tests/test_gi.py
192 @@ -783,8 +783,8 @@ class TestArray(unittest.TestCase):
193 self.assertEquals([27, "Hello"], map(GLib.Variant.unpack, GIMarshallingTests.array_gvariant_none_in(v)))
194
195 def test_bytearray_gvariant(self):
196 - v = GLib.Variant.new_bytestring("foo")
197 - self.assertEquals(v.get_bytestring(), "foo")
198 + v = GLib.Variant.new_bytestring(b"foo")
199 + self.assertEquals(v.get_bytestring(), b"foo")
200
201 class TestGArray(unittest.TestCase):
202
203 --
204 1.7.8.1