After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 622882 - Add override for TreeModel
Add override for TreeModel
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other All
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks: 622963
 
 
Reported: 2010-06-27 10:37 UTC by Philip Withnall
Modified: 2010-06-29 20:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add override for TreeModel (3.05 KB, patch)
2010-06-27 10:37 UTC, Philip Withnall
none Details | Review
Add override for TreeModel (3.63 KB, patch)
2010-06-27 12:43 UTC, Philip Withnall
none Details | Review
Add override for TreeModel implementing __len__() (2.48 KB, patch)
2010-06-29 15:38 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2010-06-27 10:37:10 UTC
Patch attached which adds overrides for Gtk.TreeModel.get_iter() and Gtk.TreeMode.get_iter_first(), replicating the API of PyGTK. Test case included.
Comment 1 Philip Withnall 2010-06-27 10:37:12 UTC
Created attachment 164736 [details] [review]
Add override for TreeModel

Closes: bgo
Comment 2 Philip Withnall 2010-06-27 12:43:22 UTC
Created attachment 164743 [details] [review]
Add override for TreeModel

Implements get_iter(), get_iter_first() and __len__().

Closes: bgo#622882
Comment 3 Philip Withnall 2010-06-27 12:44:56 UTC
Comment on attachment 164736 [details] [review]
Add override for TreeModel

Note that I wasn't able to run the tests, since I have no idea which paths to use. I thought I ran them before, but apparently not.

The overrides seem to work for Totem's Python plugins though, so the tests should run fine.
Comment 4 johnp 2010-06-28 15:22:37 UTC
This should be fixed by adding the (out) annotation for API's that take caller allocated tree iters in GTK+.  I've avoided it until now but since others want this functionality it seems that we should add it now.
Comment 5 Philip Withnall 2010-06-28 19:41:57 UTC
(In reply to comment #4)
> This should be fixed by adding the (out) annotation for API's that take caller
> allocated tree iters in GTK+.  I've avoided it until now but since others want
> this functionality it seems that we should add it now.

Ah, that makes sense. What about __len__ though?
Comment 6 Philip Withnall 2010-06-28 21:02:19 UTC
(Bug #623068 filed about adding the annotations to GTK+.)
Comment 7 johnp 2010-06-29 14:54:41 UTC
__len__ would need the override.  Please post another patch with just ___len__ without the fixes to existing iter api (I'm going to go in and fix all of that once I review and commit your GTK+ patch)
Comment 8 Philip Withnall 2010-06-29 15:38:57 UTC
Created attachment 164900 [details] [review]
Add override for TreeModel implementing __len__()
Comment 9 johnp 2010-06-29 20:03:12 UTC
Comment on attachment 164900 [details] [review]
Add override for TreeModel implementing __len__()

Looks good. Please commit
Comment 10 Philip Withnall 2010-06-29 20:18:55 UTC
commit daca09dc2c2306d4fa82a68bbdd147d4b170a1e7
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Tue Jun 29 16:37:36 2010 +0100

    Add override for TreeModel implementing __len__()
    
    Closes: bgo#622882

 gi/overrides/Gtk.py     |   11 +++++++++--
 tests/test_overrides.py |    5 +++++
 2 files changed, 14 insertions(+), 2 deletions(-)