From: DongHun Kwak Date: Tue, 11 Jul 2017 23:38:10 +0000 (+0900) Subject: Imported Upstream version 3.0.3 X-Git-Tag: upstream/3.9.92~84 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48535025dbdc1c157d8c4bdeae7bb277836dc60a;p=platform%2Fupstream%2Fpygobject2.git Imported Upstream version 3.0.3 Change-Id: Ifeef93f2f0d3bb543887ec81eef824f04f885dd1 Signed-off-by: DongHun Kwak --- diff --git a/ChangeLog b/ChangeLog index d3867df..e76e07a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,205 @@ +commit 8c95981d0ba224a577f87998030c384b3dae3d80 +Author: Tomeu Vizoso +Date: Mon Dec 12 16:20:09 2011 +0100 + + Release 3.0.3 + + NEWS | 15 +++++++++++++++ + 1 files changed, 15 insertions(+), 0 deletions(-) + +commit 58e47fd28c5d75bb78042c8f9eb5aae84de9c64d +Author: Tomeu Vizoso +Date: Mon Dec 12 16:16:44 2011 +0100 + + Pre-release version bump + + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 884468d4816fc976c0c0c72651e7f81d13f3f78b +Author: Manuel Quiñones +Date: Thu Dec 1 11:50:38 2011 -0300 + + Convert all modifier constants to Gdk.ModifierType + + Signed-off-by: Manuel Quiñones + + pygi-convert.sh | 14 ++++++++++++++ + 1 files changed, 14 insertions(+), 0 deletions(-) + +commit 654711d0f940d7480d0f1cdb25a3dc9996f7a706 +Author: Sebastian Pölsterl +Date: Tue Nov 8 12:38:12 2011 +0100 + + Convert all strings to utf-8 encoding when retrieving from TreeModel + + https://bugzilla.gnome.org/show_bug.cgi?id=663610 + + gi/overrides/Gtk.py | 15 +++++++++++++++ + tests/compathelper.py | 2 ++ + tests/test_overrides.py | 31 ++++++++++++++++++++++++++++++- + 3 files changed, 47 insertions(+), 1 deletions(-) + +commit 4f637212f13b197a95c824967a58496b9e3b877c +Author: John (J5) Palmieri +Date: Wed Nov 2 14:51:24 2011 -0400 + + add test for bytearray variants + + tests/test_gi.py | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 20ca3f129d6cc662285cce8c732b55596016aefa +Author: John (J5) Palmieri +Date: Wed Nov 2 14:50:42 2011 -0400 + + handle NULL arrays correctly for each array type + + gi/pygi-marshal-to-py.c | 11 ++++++----- + 1 files changed, 6 insertions(+), 5 deletions(-) + +commit ce2f780bffe44b1d4de617dcbce4b90c58b03c18 +Author: John (J5) Palmieri +Date: Wed Nov 2 14:17:21 2011 -0400 + + Revert "Revert "Fix array termination and size calculation"" + + This reverts commit cfda820e8d9604c5ef2ad1161c22b20080d5daf4. + + gi/pygi-marshal-from-py.c | 6 +++++- + gi/pygi-marshal-to-py.c | 8 +++++++- + 2 files changed, 12 insertions(+), 2 deletions(-) + +commit 832f16f96815adc22cc3acbeb3fa969631795a29 +Author: Owen W. Taylor +Date: Sun Oct 30 18:08:57 2011 -0400 + + pygmainloop: avoid lockups if multiple glib.MainLoop exist + + If multiple glib.MainLoop() sources exist, then we will add multiple + watches, and when python writes a byte to the wakeup pipe, all of the + sources will try to read it; only one will succeed and the others + will block. Set both ends of the pipe nonblocking to avoid this. + + https://bugzilla.gnome.org/show_bug.cgi?id=663068 + + gi/_glib/pygmainloop.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +commit 2fd3aa9d4ca0906a5e609845ee500ba72e358f94 +Author: Tomeu Vizoso +Date: Sat Oct 29 15:08:03 2011 +0200 + + Properly chain up to the class that implements a given vfunc. + + https://bugzilla.gnome.org/show_bug.cgi?id=662994 + + gi/types.py | 22 +++++++++++++--------- + tests/test_gi.py | 20 ++++++++++---------- + 2 files changed, 23 insertions(+), 19 deletions(-) + +commit cfda820e8d9604c5ef2ad1161c22b20080d5daf4 +Author: Tomeu Vizoso +Date: Wed Nov 2 14:54:21 2011 +0100 + + Revert "Fix array termination and size calculation" + + This reverts commit eef35b2df8023ffff2d195ee16c084f5cfcb6ba3. + + gi/pygi-marshal-from-py.c | 6 +----- + gi/pygi-marshal-to-py.c | 8 +------- + 2 files changed, 2 insertions(+), 12 deletions(-) + +commit eef35b2df8023ffff2d195ee16c084f5cfcb6ba3 +Author: Holger Berndt +Date: Sun Oct 30 16:36:32 2011 +0100 + + Fix array termination and size calculation + + When creating an array of element type uint8 and setting it directly + with + memcpy(), make sure that zero-termination is respected. + + When calculating the length of a zero-terminated array of type uint8, + fall back to strlen() instead of g_strv_length(). + + https://bugzilla.gnome.org/show_bug.cgi?id=662550 + + gi/pygi-marshal-from-py.c | 6 +++++- + gi/pygi-marshal-to-py.c | 8 +++++++- + 2 files changed, 12 insertions(+), 2 deletions(-) + +commit 4c1d9f01b8fa6702f73b290180f934250e179caa +Author: Daniel Drake +Date: Sun Oct 30 09:20:45 2011 +0000 + + pygi-convert: fix for Pango.Alignment + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit e3abd76096cc9f335681c7225f452c286b9c59e2 +Author: Daniel Drake +Date: Sun Oct 30 07:06:57 2011 +0000 + + pygi-convert: fix for Gtk.Orientation + + pygi-convert.sh | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 52b82c5f78ef3755388457fa9440c36ccd2dfbbf +Author: Martin Pitt +Date: Thu Oct 27 07:16:24 2011 +0200 + + Add tests for calling closures + + Add checks for correct handling of closure calls. + Regress.test_closure_one_arg() is working fine and should continue + to do so. + Regress.test_closure_variant() is known to not work yet, so mark + this as EXFAIL + for now. (See https://bugzilla.gnome.org/show_bug.cgi?id=656554) + + tests/test_everything.py | 24 ++++++++++++++++++++++++ + 1 files changed, 24 insertions(+), 0 deletions(-) + +commit c7aa0e79dfb4c1092c51ae1464b8414083b4f3fc +Author: Mikkel Kamstrup Erlandsen +Date: Tue Oct 4 12:28:26 2011 +0200 + + fix marshaling of arrays of GVariants + + Add unit tests for marshaling of arrays of variants with all + transfer modes. Requires latest gobject-introspection. + + Plug potential leaks of GArray data members + + Fix calling of wrong cleanup_from_py for arrays + + Simplify and fix logic for cleaning up arrays both in from_py() + and to_py() code paths. + + https://bugzilla.gnome.org/show_bug.cgi?id=638915 + + Signed-off-by: Martin Pitt + + gi/pygi-cache.c | 2 +- + gi/pygi-marshal-cleanup.c | 81 + +++++++++++++++++++++++++++++---------------- + gi/pygi-marshal-from-py.c | 10 ++++- + gi/pygi-marshal-to-py.c | 13 ++++++- + tests/test_gi.py | 14 +++++++- + 5 files changed, 85 insertions(+), 35 deletions(-) + +commit c2ec4d8eb46ae2e6ee4372b2a4f9d5df0e5d82f3 +Author: Ignacio Casal Quinteiro +Date: Sat Oct 22 00:20:57 2011 +0200 + + Release 3.0.2 + + NEWS | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + commit 5c24760b797e985721f7fe51d52252e4dd54a417 Author: Martin Pitt Date: Fri Oct 21 17:31:41 2011 +0200 @@ -544,9 +746,9 @@ Date: Fri Sep 2 18:39:51 2011 -0400 https://bugzilla.gnome.org/show_bug.cgi?id=658362 gi/Makefile.am | 8 +- - gi/pygi-cache.c | 669 +++++++++++---------- + gi/pygi-cache.c | 673 +++++++++++----------- gi/pygi-cache.h | 62 ++- - gi/pygi-invoke.c | 142 +++--- + gi/pygi-invoke.c | 144 +++--- gi/pygi-marshal-cleanup.c | 168 +++--- gi/pygi-marshal-cleanup.h | 128 ++-- gi/pygi-marshal-from-py.c | 1412 @@ -559,7 +761,7 @@ Date: Fri Sep 2 18:39:51 2011 -0400 gi/pygi-marshal-out.h | 144 ----- gi/pygi-marshal-to-py.c | 768 ++++++++++++++++++++++++ gi/pygi-marshal-to-py.h | 144 +++++ - 14 files changed, 3119 insertions(+), 3078 deletions(-) + 14 files changed, 3122 insertions(+), 3081 deletions(-) commit 45b0fcff9e948c65a3903c32a3957802034c5e47 Author: Dieter Verfaillie @@ -819,10 +1021,10 @@ Date: Thu Aug 25 13:57:53 2011 -0400 gi/pygi-cache.c | 1 + gi/pygi-cache.h | 1 + - gi/pygi-invoke.c | 46 - +++++++++++++++++++++++++++++----------------- - tests/test_everything.py | 8 ++++++++ - 4 files changed, 39 insertions(+), 17 deletions(-) + gi/pygi-invoke.c | 48 + ++++++++++++++++++++++++++++----------------- + tests/test_everything.py | 8 +++++++ + 4 files changed, 40 insertions(+), 18 deletions(-) commit 7a234b185b131f3eb6a6e8a8c717ddf4d508b15e Author: Xavier Claessens @@ -1847,11 +2049,11 @@ Date: Mon Jul 18 18:41:41 2011 -0400 https://bugzilla.gnome.org/show_bug.cgi?id=642048 Makefile.am | 8 +------- - configure.ac | 39 +++++++++++++++------------------------ + configure.ac | 43 +++++++++++++++++-------------------------- gi/pygi.h | 37 ------------------------------------- gobject/Makefile.am | 5 +---- tests/Makefile.am | 7 +------ - 5 files changed, 18 insertions(+), 78 deletions(-) + 5 files changed, 20 insertions(+), 80 deletions(-) commit d862168d6a82edd59547d39f5b0ab8279b1e511c Author: John (J5) Palmieri @@ -2104,9 +2306,9 @@ Date: Fri Jul 8 14:35:20 2011 -0400 [caching] refactor function names to be less confusing - gi/pygi-cache.c | 305 + gi/pygi-cache.c | 307 +++++++++++++++++++++++++++---------------------------- - 1 files changed, 149 insertions(+), 156 deletions(-) + 1 files changed, 150 insertions(+), 157 deletions(-) commit c167a9345b01c070bd5a84b4a4b3a53baf9e217d Author: John (J5) Palmieri @@ -2806,9 +3008,9 @@ Date: Mon May 23 16:59:57 2011 -0400 gi/pygi-invoke-state-struct.h | 2 + gi/pygi-marshal-cleanup.c | 301 ++++++++++++++++------------------------- - gi/pygi-marshal-cleanup.h | 43 ++++-- + gi/pygi-marshal-cleanup.h | 45 ++++--- gi/pygi-marshal.c | 15 +- - 7 files changed, 173 insertions(+), 224 deletions(-) + 7 files changed, 174 insertions(+), 225 deletions(-) commit 198714dc4585f7463f38929f1ca4e4b60a27dadb Author: John (J5) Palmieri @@ -3285,15 +3487,15 @@ Date: Mon Mar 28 18:26:09 2011 -0400 [gi-invoke-ng] refactor FunctionCache to be more generic CallableCache - gi/pygi-cache.c | 388 + gi/pygi-cache.c | 392 ++++++++++++++++++++++++++------------------------- gi/pygi-cache.h | 12 +- gi/pygi-info.c | 2 +- gi/pygi-invoke-ng.c | 40 +++--- gi/pygi-marshal.c | 140 +++++++++--------- - gi/pygi-marshal.h | 159 +++++++++------------- + gi/pygi-marshal.h | 159 ++++++++------------- gi/pygi.h | 2 +- - 7 files changed, 360 insertions(+), 383 deletions(-) + 7 files changed, 362 insertions(+), 385 deletions(-) commit 3d5d9ff5c18a850650992bdd52e8e4c722b23396 Author: John (J5) Palmieri @@ -4464,9 +4666,9 @@ Date: Mon Feb 14 18:17:20 2011 -0500 [gi-demo] Fix color dialog demo to run with new draw, style and color apis - demos/gtk-demo/demos/colorselector.py | 42 + demos/gtk-demo/demos/colorselector.py | 44 ++++++++++++-------------------- - 1 files changed, 16 insertions(+), 26 deletions(-) + 1 files changed, 17 insertions(+), 27 deletions(-) commit f94a96c53e9432ac085bd05acee7ebdd2803fbad Author: John (J5) Palmieri @@ -4508,9 +4710,9 @@ Date: Mon Feb 14 16:47:03 2011 -0500 [gi-demos] fix drawingarea app to use the new draw api - demos/gtk-demo/demos/drawingarea.py | 138 + demos/gtk-demo/demos/drawingarea.py | 144 ++++++++++++----------------------- - 1 files changed, 47 insertions(+), 91 deletions(-) + 1 files changed, 50 insertions(+), 94 deletions(-) commit 8385afbbc5df295d9b7cd3b5d19c90faa1f7ea8e Author: John (J5) Palmieri @@ -4930,10 +5132,10 @@ Date: Sun Jan 30 11:30:54 2011 -0500 values based on if they are in, out or inout * in invoke we order the pointers based on their direction - gi/pygi-cache.c | 1441 + gi/pygi-cache.c | 1445 ++++++++++++++++++++++++++---------------------------- gi/pygi-invoke.c | 19 +- - 2 files changed, 709 insertions(+), 751 deletions(-) + 2 files changed, 711 insertions(+), 753 deletions(-) commit 2b185362de45f46ce0f0b8816499aef06ab1ad1e Author: John (J5) Palmieri @@ -4951,9 +5153,9 @@ Date: Sat Jan 29 13:48:23 2011 -0500 [gi] fix sequence caching to support out - gi/pygi-cache.c | 109 + gi/pygi-cache.c | 111 +++++++++++++++++++++++++++++++++++++++++++------------ - 1 files changed, 86 insertions(+), 23 deletions(-) + 1 files changed, 87 insertions(+), 24 deletions(-) commit 69207910209ebfe450df616aeb8fa4cc2e7eccf3 Author: Martin Pitt @@ -5103,11 +5305,11 @@ Date: Fri Jan 21 17:24:49 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=640197 - gobject/gobjectmodule.c | 35 ++-------------------- + gobject/gobjectmodule.c | 35 ++------------------- gobject/pygobject-private.h | 5 +++ - gobject/pygobject.c | 69 + gobject/pygobject.c | 71 +++++++++++++++++++++++++----------------- - 3 files changed, 49 insertions(+), 60 deletions(-) + 3 files changed, 50 insertions(+), 61 deletions(-) commit a3e0cfe8924887ecd1e07cedd2cfb999c853ac62 Author: John (J5) Palmieri @@ -5308,10 +5510,10 @@ Date: Thu Jan 20 16:26:18 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=640073 - gi/types.py | 100 - +++++++++++++++++++++++++++++++++-------------------- + gi/types.py | 104 + +++++++++++++++++++++++++++++++++--------------------- tests/test_gi.py | 13 +++++++ - 2 files changed, 75 insertions(+), 38 deletions(-) + 2 files changed, 77 insertions(+), 40 deletions(-) commit 8f4e6536f3c2edf38a45632d1c23eb7c6681c3be Author: Sebastian Pölsterl @@ -5504,10 +5706,10 @@ Date: Wed Jan 19 11:41:11 2011 +0100 https://bugzilla.gnome.org/show_bug.cgi?id=639939 - gi/overrides/GLib.py | 199 + gi/overrides/GLib.py | 229 +++++++++++++++++++++++++---------------------- - tests/test_overrides.py | 159 +++++++++++++++++++++++++++++++++++-- - 2 files changed, 258 insertions(+), 100 deletions(-) + tests/test_overrides.py | 159 +++++++++++++++++++++++++++++++-- + 2 files changed, 273 insertions(+), 115 deletions(-) commit ac095f5435f106e175fa3297cb273e63c85d2809 Author: Tomeu Vizoso @@ -5895,10 +6097,10 @@ Date: Wed Jan 19 09:13:44 2011 -0500 [gi] fix marshalling structs - gi/pygi-argument.c | 45 ++++++++++++++++++++++++++++++++++----------- + gi/pygi-argument.c | 47 +++++++++++++++++++++++++++++++++++------------ gi/pygi-foreign.c | 18 ++++++++++++------ gi/pygi-foreign.h | 8 ++++---- - 3 files changed, 50 insertions(+), 21 deletions(-) + 3 files changed, 51 insertions(+), 22 deletions(-) commit b2189424f9dd6d3a4a5b9792f0d5843fc27657d1 Author: Sebastian Pölsterl @@ -6430,12 +6632,12 @@ Date: Mon Jan 17 12:31:03 2011 -0500 support callbacks - gi/pygi-argument.c | 68 +++++++++++++++++++++++++++++++++++++++++++-- - gi/pygi-cache.c | 78 - ++++++++++++++++++++++++++++++++++++++++------------ + gi/pygi-argument.c | 68 ++++++++++++++++++++++++++++++++++++++++++-- + gi/pygi-cache.c | 80 + +++++++++++++++++++++++++++++++++++++++------------ gi/pygi-cache.h | 13 +++++++- gi/pygi-invoke.c | 2 +- - 4 files changed, 137 insertions(+), 24 deletions(-) + 4 files changed, 138 insertions(+), 25 deletions(-) commit 914d3a0a29680f4d3aa0e1f8afdd625b017b013a Author: Sebastian Pölsterl @@ -10391,15 +10593,15 @@ Date: Thu Jul 15 13:31:33 2010 +0200 gi/Makefile.am | 2 + gi/pygi-argument.c | 2 +- - gi/pygi-foreign-cairo.c | 16 ++++---- - gi/pygi-foreign.c | 105 + gi/pygi-foreign-cairo.c | 16 +++--- + gi/pygi-foreign.c | 107 ++++++++++++++++++++++++++++----------------- gi/pygi-foreign.h | 7 +-- gi/pygi-invoke.c | 18 ++++---- gi/pygi-struct.c | 10 ++++- gi/pygi.h | 9 ++-- - tests/test_everything.py | 8 ++++ - 9 files changed, 109 insertions(+), 68 deletions(-) + tests/test_everything.py | 8 +++ + 9 files changed, 110 insertions(+), 69 deletions(-) commit 3b3bd4da3fbc993fa7f7cfb46ed4e67671c94cc0 Author: Tomeu Vizoso @@ -10670,16 +10872,16 @@ Date: Tue Jun 29 10:27:39 2010 +0200 https://bugzilla.gnome.org/show_bug.cgi?id=623021 configure.ac | 2 + - gi/Makefile.am | 38 ++++++++++----- + gi/Makefile.am | 38 +++++++++----- gi/gimodule.c | 8 +--- gi/pygi-argument.c | 10 +--- gi/pygi-foreign-cairo.c | 56 ++++++++++++++++----- gi/pygi-foreign-cairo.h | 55 --------------------- - gi/pygi-foreign.c | 123 + gi/pygi-foreign.c | 125 ++++++++++++++++++++++++++++------------------- - gi/pygi-foreign.h | 31 +++++------- - gi/pygi.h | 40 ++++++++++++++-- - 9 files changed, 195 insertions(+), 168 deletions(-) + gi/pygi-foreign.h | 31 +++++------ + gi/pygi.h | 40 +++++++++++++-- + 9 files changed, 196 insertions(+), 169 deletions(-) commit a6a90551311bc64f037cbd442e13f70c30060871 Author: Tomeu Vizoso @@ -11764,12 +11966,12 @@ Date: Wed May 26 12:19:17 2010 +0200 This won't affect git blame nor git diff if the switch -w is used. gi/gimodule.c | 138 ++++---- - gi/pygi-argument.c | 958 + gi/pygi-argument.c | 960 +++++++++++++++++++++++----------------------- gi/pygi-boxed.c | 108 +++--- - gi/pygi-callbacks.c | 152 ++++---- + gi/pygi-callbacks.c | 154 ++++---- gi/pygi-callbacks.h | 8 +- - gi/pygi-closure.c | 266 +++++++------- + gi/pygi-closure.c | 270 +++++++------- gi/pygi-closure.h | 18 +- gi/pygi-foreign-cairo.c | 36 +- gi/pygi-foreign-cairo.h | 36 +- @@ -11782,7 +11984,7 @@ Date: Wed May 26 12:19:17 2010 +0200 gi/pygi-type.c | 32 +- gi/pygi.h | 20 +- gi/pygobject-external.h | 14 +- - 18 files changed, 1540 insertions(+), 1538 deletions(-) + 18 files changed, 1544 insertions(+), 1542 deletions(-) commit 6156f15cb15b4c20e975527227135d49207c520a Author: Tomeu Vizoso @@ -12257,9 +12459,9 @@ Date: Mon Apr 26 11:41:06 2010 +0200 gi/pygi-callbacks.c | 22 +- gi/pygi-callbacks.h | 4 +- - gi/pygi-info.c | 576 + gi/pygi-info.c | 582 +++++++++++++++++++++++++++++---------------------- - 3 files changed, 343 insertions(+), 259 deletions(-) + 3 files changed, 346 insertions(+), 262 deletions(-) commit 7fc5528273edae5ecdd5d8bdf0e5b898eec7a624 Author: Zach Goldberg @@ -12571,9 +12773,9 @@ Date: Sun Apr 18 13:11:11 2010 -0400 gi/pygi-info.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++- gi/pygi-info.h | 1 + - gi/types.py | 42 ++++++++++++++++------- + gi/types.py | 44 +++++++++++++++++-------- tests/test_gi.py | 18 ++++++++++ - 9 files changed, 226 insertions(+), 20 deletions(-) + 9 files changed, 227 insertions(+), 21 deletions(-) commit e239faacb4798fe2d166233ca1a19a843a6225e3 Author: Zach Goldberg @@ -13979,8 +14181,8 @@ Date: Sat Nov 28 00:22:21 2009 +0100 gi/pygi-argument.c | 516 ++++++++++++++++++++++++++++++++++++++++++---------- - gi/pygi-info.c | 327 +++++++++++++++++---------------- - 2 files changed, 593 insertions(+), 250 deletions(-) + gi/pygi-info.c | 333 +++++++++++++++++---------------- + 2 files changed, 596 insertions(+), 253 deletions(-) commit d1ae73f3cf7cebdb74c9ec56b08928a2a53b9de6 Author: Johan Dahlin @@ -14935,9 +15137,9 @@ Date: Tue Jun 2 23:40:41 2009 +0200 Disables the tests that fail in tests/test_girepository.py. - tests/test_girepository.py | 232 + tests/test_girepository.py | 242 +++++++++++++++++++++++++++++++++----------- - 1 files changed, 177 insertions(+), 55 deletions(-) + 1 files changed, 182 insertions(+), 60 deletions(-) commit a4469a3f7d32a25156bae5e7aef9ec4ae5f6e140 Author: Simon van der Linden diff --git a/NEWS b/NEWS index 826def6..250a97d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,18 @@ +3.0.3 12-Dec-2011 + - Convert all modifier constants to Gdk.ModifierType (Manuel Quiñones) + - Convert all strings to utf-8 encoding when retrieving from TreeModel (Sebastian Pöl + - add test for bytearray variants (John (J5) Palmieri) + - handle NULL arrays correctly for each array type (John (J5) Palmieri) + - Revert "Revert "Fix array termination and size calculation"" (John (J5) Palmieri) + - pygmainloop: avoid lockups if multiple glib.MainLoop exist (Owen W. Taylor) + - Properly chain up to the class that implements a given vfunc. (Tomeu Vizoso) + - Revert "Fix array termination and size calculation" (Tomeu Vizoso) + - Fix array termination and size calculation (Holger Berndt) + - pygi-convert: fix for Pango.Alignment (Daniel Drake) + - pygi-convert: fix for Gtk.Orientation (Daniel Drake) + - Add tests for calling closures (Martin Pitt) + - fix marshaling of arrays of GVariants (Mikkel Kamstrup Erlandsen) + 3.0.2 21-Oct-2011 - Add tests for boxed properties. (Ignacio Casal Quinteiro) - Allow GBoxed types as property (Timo Vanwynsberghe) diff --git a/PKG-INFO b/PKG-INFO index 5f9f03e..ef709c9 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: PyGObject -Version: 3.0.2 +Version: 3.0.3 Summary: Python bindings for GObject Home-page: http://www.pygtk.org/ Author: James Henstridge @@ -8,7 +8,7 @@ Author-email: james@daa.com.au Maintainer: Johan Dahlin Maintainer-email: johan@gnome.org License: GNU LGPL -Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.0/pygobject-3.0.2.tar.gz +Download-url: ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.0/pygobject-3.0.3.tar.gz Description: Python bindings for GLib and GObject Platform: POSIX, Windows Classifier: Development Status :: 5 - Production/Stable diff --git a/configure b/configure index 5714ee7..bb92045 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for pygobject 3.0.2. +# Generated by GNU Autoconf 2.68 for pygobject 3.0.3. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pygobject' PACKAGE_TARNAME='pygobject' -PACKAGE_VERSION='3.0.2' -PACKAGE_STRING='pygobject 3.0.2' +PACKAGE_VERSION='3.0.3' +PACKAGE_STRING='pygobject 3.0.3' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject' PACKAGE_URL='' @@ -1358,7 +1358,7 @@ if test "$ac_init_help" = "long"; then # 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.0.2 to adapt to many kinds of systems. +\`configure' configures pygobject 3.0.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1428,7 +1428,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pygobject 3.0.2:";; + short | recursive ) echo "Configuration of pygobject 3.0.3:";; esac cat <<\_ACEOF @@ -1553,7 +1553,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pygobject configure 3.0.2 +pygobject configure 3.0.3 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1831,7 +1831,7 @@ cat >config.log <<_ACEOF 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.0.2, which was +It was created by pygobject $as_me 3.0.3, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2195,9 +2195,9 @@ $as_echo "#define PYGOBJECT_MINOR_VERSION 0" >>confdefs.h PYGOBJECT_MINOR_VERSION=0 -$as_echo "#define PYGOBJECT_MICRO_VERSION 2" >>confdefs.h +$as_echo "#define PYGOBJECT_MICRO_VERSION 3" >>confdefs.h -PYGOBJECT_MICRO_VERSION=2 +PYGOBJECT_MICRO_VERSION=3 ac_config_headers="$ac_config_headers config.h" @@ -2681,7 +2681,7 @@ fi # Define the identity of the package. PACKAGE='pygobject' - VERSION='3.0.2' + VERSION='3.0.3' cat >>confdefs.h <<_ACEOF @@ -12017,7 +12017,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -pygobject config.lt 3.0.2 +pygobject config.lt 3.0.3 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. @@ -16723,7 +16723,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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.0.2, which was +This file was extended by pygobject $as_me 3.0.3, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16789,7 +16789,7 @@ _ACEOF 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.0.2 +pygobject config.status 3.0.3 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index f90aaaa..a663ca8 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ m4_define(python3_min_ver, 3.1) dnl the pygobject version number m4_define(pygobject_major_version, 3) m4_define(pygobject_minor_version, 0) -m4_define(pygobject_micro_version, 2) +m4_define(pygobject_micro_version, 3) m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version) dnl versions of packages we require ... diff --git a/gi/_glib/pygmainloop.c b/gi/_glib/pygmainloop.c index 614a662..43dcf92 100644 --- a/gi/_glib/pygmainloop.c +++ b/gi/_glib/pygmainloop.c @@ -217,7 +217,10 @@ pyg_signal_watch_new(void) g_error("Cannot create main loop pipe: %s\n", g_strerror(errno)); - /* Make the write end of the fd non blocking */ + /* Make both ends of the fd non blocking */ + flag = fcntl(pipe_fds[0], F_GETFL, 0); + flag |= O_NONBLOCK; + fcntl(pipe_fds[0], F_SETFL, flag); flag = fcntl(pipe_fds[1], F_GETFL, 0); flag |= O_NONBLOCK; fcntl(pipe_fds[1], F_SETFL, flag); diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py index 7945cc8..e0d038a 100644 --- a/gi/overrides/Gtk.py +++ b/gi/overrides/Gtk.py @@ -797,6 +797,13 @@ class TreeModel(Gtk.TreeModel): self.set_value(treeiter, i, value) + def _decode_value(self, treeiter, column, value): + type_ = self.get_column_type(column) + if type_ == GObject.TYPE_STRING and sys.version_info < (3, 0): + value = value.decode('UTF-8') + + return value + def _convert_value(self, treeiter, column, value): if value is None: return @@ -965,6 +972,10 @@ class ListStore(Gtk.ListStore, TreeModel, TreeSortable): value = self._convert_value(treeiter, column, value) Gtk.ListStore.set_value(self, treeiter, column, value) + def get_value(self, treeiter, column): + value = Gtk.ListStore.get_value(self, treeiter, column) + return self._decode_value(treeiter, column, value) + def set(self, treeiter, *args): def _set_lists(columns, values): @@ -1180,6 +1191,10 @@ class TreeStore(Gtk.TreeStore, TreeModel, TreeSortable): value = self._convert_value(treeiter, column, value) Gtk.TreeStore.set_value(self, treeiter, column, value) + def get_value(self, treeiter, column): + value = Gtk.TreeStore.get_value(self, treeiter, column) + return self._decode_value(treeiter, column, value) + def set(self, treeiter, *args): def _set_lists(columns, values): diff --git a/gi/pygi-cache.c b/gi/pygi-cache.c index 41ca32c..5dc811a 100644 --- a/gi/pygi-cache.c +++ b/gi/pygi-cache.c @@ -498,7 +498,7 @@ _arg_cache_from_py_array_setup (PyGIArgCache *arg_cache, callable_cache->args_cache[seq_cache->len_arg_index] = child_cache; } - arg_cache->from_py_cleanup = _pygi_marshal_cleanup_to_py_array; + arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_array; return TRUE; } diff --git a/gi/pygi-marshal-cleanup.c b/gi/pygi-marshal-cleanup.c index 8ed9bdb..f80ebfa 100644 --- a/gi/pygi-marshal-cleanup.c +++ b/gi/pygi-marshal-cleanup.c @@ -273,6 +273,37 @@ _pygi_marshal_cleanup_to_py_interface_struct_foreign (PyGIInvokeState *state, data); } +static GArray* +_wrap_c_array (PyGIInvokeState *state, + PyGISequenceCache *sequence_cache, + gpointer data) +{ + GArray *array_; + gsize len; + + if (sequence_cache->fixed_size >= 0) { + len = sequence_cache->fixed_size; + } else if (sequence_cache->is_zero_terminated) { + len = g_strv_length ((gchar **)data); + } else { + GIArgument *len_arg = state->args[sequence_cache->len_arg_index]; + len = len_arg->v_long; + } + + array_ = g_array_new (FALSE, + FALSE, + sequence_cache->item_size); + + if (array_ == NULL) + return NULL; + + g_free (array_->data); + array_->data = data; + array_->len = len; + + return array_; +} + void _pygi_marshal_cleanup_from_py_array (PyGIInvokeState *state, PyGIArgCache *arg_cache, @@ -286,26 +317,11 @@ _pygi_marshal_cleanup_from_py_array (PyGIInvokeState *state, /* If this isn't a garray create one to help process variable sized array elements */ if (sequence_cache->array_type == GI_ARRAY_TYPE_C) { - gsize len; - if (sequence_cache->fixed_size >= 0) { - len = sequence_cache->fixed_size; - } else if (sequence_cache->is_zero_terminated) { - len = g_strv_length ((gchar **)data); - } else { - GIArgument *len_arg = state->args[sequence_cache->len_arg_index]; - len = len_arg->v_long; - } - - array_ = g_array_new (FALSE, - FALSE, - sequence_cache->item_size); - + array_ = _wrap_c_array (state, sequence_cache, data); + if (array_ == NULL) return; - - array_->data = data; - array_->len = len; - + } else { array_ = (GArray *) data; } @@ -324,12 +340,12 @@ _pygi_marshal_cleanup_from_py_array (PyGIInvokeState *state, } } - if (state->failed || - arg_cache->transfer == GI_TRANSFER_NOTHING || - arg_cache->transfer == GI_TRANSFER_CONTAINER) { + /* Only free the array when we didn't transfer ownership */ + if (sequence_cache->array_type == GI_ARRAY_TYPE_C) { + g_array_free (array_, arg_cache->transfer == GI_TRANSFER_NOTHING); + } else if (state->failed || + arg_cache->transfer == GI_TRANSFER_NOTHING) { g_array_free (array_, TRUE); - } else if (sequence_cache->array_type == GI_ARRAY_TYPE_C) { - g_array_free (array_, FALSE); } } } @@ -343,12 +359,20 @@ _pygi_marshal_cleanup_to_py_array (PyGIInvokeState *state, PyGISequenceCache *sequence_cache = (PyGISequenceCache *)arg_cache; if (arg_cache->transfer == GI_TRANSFER_EVERYTHING || - arg_cache->transfer == GI_TRANSFER_CONTAINER) { - GArray *array_ = (GArray *) data; + arg_cache->transfer == GI_TRANSFER_CONTAINER) { + GArray *array_; + PyGISequenceCache *sequence_cache = (PyGISequenceCache *)arg_cache; + /* If this isn't a garray create one to help process variable sized + array elements */ if (sequence_cache->array_type == GI_ARRAY_TYPE_C) { - g_free (data); - return; + array_ = _wrap_c_array (state, sequence_cache, data); + + if (array_ == NULL) + return; + + } else { + array_ = (GArray *) data; } if (sequence_cache->item_cache->to_py_cleanup != NULL) { @@ -363,8 +387,7 @@ _pygi_marshal_cleanup_to_py_array (PyGIInvokeState *state, } } - if (arg_cache->transfer == GI_TRANSFER_EVERYTHING) - g_array_free (array_, TRUE); + g_array_free (array_, TRUE); } } diff --git a/gi/pygi-marshal-from-py.c b/gi/pygi-marshal-from-py.c index 1f807b4..3b3109c 100644 --- a/gi/pygi-marshal-from-py.c +++ b/gi/pygi-marshal-from-py.c @@ -794,7 +794,11 @@ _pygi_marshal_from_py_array (PyGIInvokeState *state, if (sequence_cache->item_cache->type_tag == GI_TYPE_TAG_UINT8 && PYGLIB_PyBytes_Check (py_arg)) { memcpy(array_->data, PYGLIB_PyBytes_AsString (py_arg), length); - + if (sequence_cache->is_zero_terminated) { + /* If array_ has been created with zero_termination, space for the + * terminator is properly allocated, so we're not off-by-one here. */ + array_->data[length] = '\0'; + } goto array_success; } @@ -831,8 +835,14 @@ _pygi_marshal_from_py_array (PyGIInvokeState *state, PyGIMarshalCleanupFunc from_py_cleanup = item_arg_cache->from_py_cleanup; gboolean is_boxed = g_type_is_a (item_iface_cache->g_type, G_TYPE_BOXED); gboolean is_gvalue = item_iface_cache->g_type == G_TYPE_VALUE; - - if (!is_boxed || is_gvalue) { + gboolean is_gvariant = item_iface_cache->g_type == G_TYPE_VARIANT; + + if (is_gvariant) { + /* Item size will always be that of a pointer, + * since GVariants are opaque hence always passed by ref */ + g_assert (item_size == sizeof (item.v_pointer)); + g_array_insert_val (array_, i, item.v_pointer); + } else if (!is_boxed || is_gvalue) { memcpy (array_->data + (i * item_size), item.v_pointer, item_size); if (from_py_cleanup) from_py_cleanup (state, item_arg_cache, item.v_pointer, TRUE); diff --git a/gi/pygi-marshal-to-py.c b/gi/pygi-marshal-to-py.c index 48dfa08..1e4a8aa 100644 --- a/gi/pygi-marshal-to-py.c +++ b/gi/pygi-marshal-to-py.c @@ -273,9 +273,15 @@ _pygi_marshal_to_py_array (PyGIInvokeState *state, if (seq_cache->array_type == GI_ARRAY_TYPE_C) { gsize len; if (seq_cache->fixed_size >= 0) { + g_assert(arg->v_pointer != NULL); len = seq_cache->fixed_size; } else if (seq_cache->is_zero_terminated) { - len = g_strv_length ((gchar **)arg->v_pointer); + g_assert(arg->v_pointer != NULL); + if(seq_cache->item_cache->type_tag == GI_TYPE_TAG_UINT8) { + len = strlen (arg->v_pointer); + } else { + len = g_strv_length ((gchar **)arg->v_pointer); + } } else { GIArgument *len_arg = state->args[seq_cache->len_arg_index]; len = len_arg->v_long; @@ -287,12 +293,14 @@ _pygi_marshal_to_py_array (PyGIInvokeState *state, if (array_ == NULL) { PyErr_NoMemory (); - if (arg_cache->transfer == GI_TRANSFER_EVERYTHING) + if (arg_cache->transfer == GI_TRANSFER_EVERYTHING && arg->v_pointer != NULL) g_free (arg->v_pointer); return NULL; } + if (array_->data != NULL) + g_free (array_->data); array_->data = arg->v_pointer; array_->len = len; } @@ -331,10 +339,18 @@ _pygi_marshal_to_py_array (PyGIInvokeState *state, item_arg.v_pointer = g_ptr_array_index ( ( GPtrArray *)array_, i); } else if (item_arg_cache->type_tag == GI_TYPE_TAG_INTERFACE) { PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *) item_arg_cache; + gboolean is_gvariant = iface_cache->g_type == G_TYPE_VARIANT; + // FIXME: This probably doesn't work with boxed types or gvalues. See fx. _pygi_marshal_from_py_array() switch (g_base_info_get_type (iface_cache->interface_info)) { case GI_INFO_TYPE_STRUCT: - if (arg_cache->transfer == GI_TRANSFER_EVERYTHING) { + if (is_gvariant) { + g_assert (item_size == sizeof (gpointer)); + if (arg_cache->transfer == GI_TRANSFER_EVERYTHING) + item_arg.v_pointer = g_variant_ref_sink (g_array_index (array_, gpointer, i)); + else + item_arg.v_pointer = g_array_index (array_, gpointer, i); + } else if (arg_cache->transfer == GI_TRANSFER_EVERYTHING) { gpointer *_struct = g_malloc (item_size); memcpy (_struct, array_->data + i * item_size, item_size); diff --git a/gi/types.py b/gi/types.py index 58eec51..f767e3c 100644 --- a/gi/types.py +++ b/gi/types.py @@ -48,15 +48,20 @@ def Function(info): return function -def NativeVFunc(info, cls): +class NativeVFunc(object): - def native_vfunc(*args, **kwargs): - return info.invoke(cls.__gtype__, *args, **kwargs) - native_vfunc.__info__ = info - native_vfunc.__name__ = info.get_name() - native_vfunc.__module__ = info.get_namespace() + def __init__(self, info): + self._info = info + + def __get__(self, instance, klass): + def native_vfunc(*args, **kwargs): + return self._info.invoke(klass.__gtype__, *args, **kwargs) + native_vfunc.__info__ = self._info + native_vfunc.__name__ = self._info.get_name() + native_vfunc.__module__ = self._info.get_namespace() + + return native_vfunc - return native_vfunc def Constructor(info): @@ -147,7 +152,6 @@ class MetaClassHelper(object): base_info.get_name(), ambiguous_base.__info__.get_namespace(), ambiguous_base.__info__.get_name())) - hook_up_vfunc_implementation(vfunc_info, cls.__gtype__, py_vfunc) @@ -162,7 +166,7 @@ class MetaClassHelper(object): for vfunc_info in class_info.get_vfuncs(): name = 'do_%s' % vfunc_info.get_name() - value = NativeVFunc(vfunc_info, cls) + value = NativeVFunc(vfunc_info) setattr(cls, name, value) def find_vfunc_info_in_interface(bases, vfunc_name): diff --git a/tests/compathelper.py b/tests/compathelper.py index 2465747..b061335 100644 --- a/tests/compathelper.py +++ b/tests/compathelper.py @@ -62,8 +62,10 @@ if sys.version_info >= (3, 0): ''' _unicode = lambda s: str(s) + _unichr = chr else: _long = long _basestring = basestring _bytes = str _unicode = lambda s: unicode(s, 'UTF-8') + _unichr = unichr diff --git a/tests/test_everything.py b/tests/test_everything.py index 19d345b..43735e5 100644 --- a/tests/test_everything.py +++ b/tests/test_everything.py @@ -350,6 +350,30 @@ class TestCallbacks(unittest.TestCase): # make sure this doesn't assert or crash Everything.test_simple_callback(None) +class TestClosures(unittest.TestCase): + def test_int_arg(self): + def callback(num): + self.called = True + return num+1 + + self.called = False + result = Everything.test_closure_one_arg(callback, 42) + self.assertTrue(self.called) + self.assertEqual(result, 43) + + # https://bugzilla.gnome.org/show_bug.cgi?id=656554 + @unittest.expectedFailure + def test_variant(self): + def callback(variant): + self.assertEqual(variant.get_type_string(), 'i') + self.called = True + return GLib.Variant('i', variant.get_int32() + 1) + + self.called = False + result = Everything.test_closure_variant(callback, GLib.Variant('i', 42)) + self.assertTrue(self.called) + self.assertEqual(result.get_type_string(), 'i') + self.assertEqual(result.get_int32(), 43) class TestProperties(unittest.TestCase): diff --git a/tests/test_gi.py b/tests/test_gi.py index dd91cb8..0a9b1b2 100644 --- a/tests/test_gi.py +++ b/tests/test_gi.py @@ -10,7 +10,7 @@ import shutil import os import locale import subprocess -from gi.repository import GObject +from gi.repository import GObject, GLib from gi.repository import GIMarshallingTests @@ -769,6 +769,22 @@ class TestArray(unittest.TestCase): def test_gstrv_inout(self): self.assertEquals(['-1', '0', '1', '2'], GIMarshallingTests.gstrv_inout(['0', '1', '2'])) + + def test_array_gvariant_none_in(self): + v = [GLib.Variant("i", 27), GLib.Variant("s", "Hello")] + self.assertEquals([27, "Hello"], map(GLib.Variant.unpack, GIMarshallingTests.array_gvariant_none_in(v))) + + def test_array_gvariant_container_in(self): + v = [GLib.Variant("i", 27), GLib.Variant("s", "Hello")] + self.assertEquals([27, "Hello"], map(GLib.Variant.unpack, GIMarshallingTests.array_gvariant_none_in(v))) + + def test_array_gvariant_full_in(self): + v = [GLib.Variant("i", 27), GLib.Variant("s", "Hello")] + self.assertEquals([27, "Hello"], map(GLib.Variant.unpack, GIMarshallingTests.array_gvariant_none_in(v))) + + def test_bytearray_gvariant(self): + v = GLib.Variant.new_bytestring("foo") + self.assertEquals(v.get_bytestring(), "foo") class TestGArray(unittest.TestCase): @@ -1627,16 +1643,6 @@ class TestPythonGObject(unittest.TestCase): self.assertTrue('do_method_with_default_implementation' in GIMarshallingTests.Object.__dict__) self.assertTrue('do_method_with_default_implementation' not in GIMarshallingTests.SubObject.__dict__) - # Here we check that accessing a vfunc from the subclass returns the same wrapper object, - # meaning that multiple wrapper objects have not been created for the same vfunc. - func1 = GIMarshallingTests.Object.do_method_with_default_implementation - func2 = GIMarshallingTests.SubObject.do_method_with_default_implementation - if sys.version_info < (3,0): - func1 = func1.im_func - func2 = func2.im_func - - self.assertTrue(func1 is func2) - def test_subobject_with_interface_and_non_vfunc_do_method(self): # There was a bug for searching for vfuncs in interfaces. It was # triggered by having a do_* method that wasn't overriding @@ -1645,6 +1651,16 @@ class TestPythonGObject(unittest.TestCase): def do_method_not_a_vfunc(self): pass + def test_subsubobject(self): + class SubSubSubObject(GIMarshallingTests.SubSubObject): + def do_method_deep_hierarchy(self, num): + self.props.int = num * 2 + + sub_sub_sub_object = SubSubSubObject() + GIMarshallingTests.SubSubObject.do_method_deep_hierarchy(sub_sub_sub_object, 5) + self.assertEqual(sub_sub_sub_object.props.int, 5) + + class TestMultiOutputArgs(unittest.TestCase): def test_int_out_out(self): diff --git a/tests/test_overrides.py b/tests/test_overrides.py index 8974273..e875d30 100644 --- a/tests/test_overrides.py +++ b/tests/test_overrides.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab @@ -7,7 +8,7 @@ import sys import os sys.path.insert(0, "../") -from compathelper import _long, _unicode, _bytes +from compathelper import _long, _unicode, _bytes, _unichr from gi.repository import GLib from gi.repository import GObject @@ -1261,6 +1262,34 @@ class TestGtk(unittest.TestCase): model[0] = (3, "three", -0.3) + def test_tree_model_unicode(self): + model = Gtk.ListStore(str) + + text = (_unicode("just\na\tstring"), + _unicode("Tr") + _unichr(0xf6) + _unicode("del"), + _unicode("N") + _unichr(0xe1) + _unicode("m") + _unichr(0xe8), + _unichr(0xff) + _unichr(0xdf) + _unicode("er"), + _unichr(0x152) + _unichr(0x180) + _unichr(0x1d25)) + + for item in text: + model.append([item]) + + def byte_compare(have, expected): + if sys.version_info < (3, 0): + self.assertTrue(isinstance(have, unicode)) + else: + self.assertTrue(isinstance(have, str)) + + self.assertEqual(len(have), len(expected)) + for i in range(len(expected)): + a = have[i] + b = expected[i] + self.assertEqual(a, b) + self.assertEqual(ord(a), ord(b)) + + for i in range(len(model)): + byte_compare(model[i][0], text[i]) + def test_tree_row_slice(self): model = Gtk.ListStore(int, str, float) model.append([1, "one", -0.1])