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 679999 - can't initialize 'Gtk.TreeModelFilter' with a model
can't initialize 'Gtk.TreeModelFilter' with a model
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
3.3.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
: 679998 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-07-16 11:46 UTC by Manuel Quiñones
Modified: 2012-07-16 14:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Manuel Quiñones 2012-07-16 11:46:33 UTC
I've heard that Gtk.TreeModelFilter.new(model) was working before, but I get 'TreeModelFilter' has no attribute 'new' in current git.

magcius said on IRC that this is because is incorrectly parsed, we have model.filter_new().  gtk_tree_model_filter_new takes a GtkTreeModel as its first argument, it's treated as Gtk.TreeModel.filter_new .
Comment 1 Tobias Mueller 2012-07-16 11:52:58 UTC
*** Bug 679998 has been marked as a duplicate of this bug. ***
Comment 2 Martin Pitt 2012-07-16 14:13:30 UTC
Indeed, and calling Gtk.TreeModel.filter_new does not work either, so I think we can fix this without breaking currently working API:

$ python3 -c 'from gi.repository import Gtk; print(Gtk.TreeModel.filter_new(None))'
Traceback (most recent call last):
  • File "<string>", line 1 in <module>
  • File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 965 in filter_new
    return super(TreeModel, self).filter_new(root)
AttributeError: 'super' object has no attribute 'filter_new'

This needs to be fixed in the GTK annotations, reassigning.
Comment 3 Martin Pitt 2012-07-16 14:20:00 UTC
Actually, ignore me. gtk_tree_model_filter_new() is _not_ a constructor of GtkTreeModelFilter, it is indeed a method of GtkTreeModel. You indeed have to call .filter_new(root) on an already existing TreeModel instance.
Comment 4 Manuel Quiñones 2012-07-16 14:28:50 UTC
Thanks Martin, then the pygi-convert.sh script is wrong in this line:

    -pe "s/self._model.filter_new\(\)/Gtk.TreeModelFilter.new\(self._model, None\)/g;" \
Comment 5 Martin Pitt 2012-07-16 14:36:54 UTC
Ah, thanks. Fixed:

http://git.gnome.org/browse/pygobject/commit/?id=30935fe31