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 660798 - No way to have a GtkTextIter as a prop
No way to have a GtkTextIter as a prop
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2011-10-03 15:35 UTC by Ignacio Casal Quinteiro (nacho)
Modified: 2011-10-10 09:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow GBoxed types as property (1.09 KB, patch)
2011-10-03 18:09 UTC, Timo Vanwynsberghe
none Details | Review
Allow GBoxed types as property (1.41 KB, patch)
2011-10-04 09:17 UTC, Timo Vanwynsberghe
committed Details | Review
boxed tests (1.92 KB, patch)
2011-10-08 09:48 UTC, Ignacio Casal Quinteiro (nacho)
rejected Details | Review

Description Ignacio Casal Quinteiro (nacho) 2011-10-03 15:35:43 UTC
SSIA see i.e http://git.gnome.org/browse/gedit/tree/plugins/snippets/snippets/windowactivatable.py#n31
Comment 1 Timo Vanwynsberghe 2011-10-03 18:08:49 UTC
Looking at the propertyhelper file, the method that errors out checks for standard Python types and GObject/GEnum types. A Gtk.TextIter however is a GBoxed type.
I'll attach a possible patch, without really testing. But the GBoxed type has a __gtype__ method too.
Comment 2 Timo Vanwynsberghe 2011-10-03 18:09:25 UTC
Created attachment 198130 [details] [review]
Allow GBoxed types as property
Comment 3 Ignacio Casal Quinteiro (nacho) 2011-10-03 18:14:02 UTC
It does not work for me:

Gtk-Message: Failed to load module "canberra-gtk-module"
Traceback (most recent call last):
  • File "/opt/gnome/lib64/gedit/plugins/snippets/__init__.py", line 19 in <module>
    from windowactivatable import WindowActivatable
  • File "/opt/gnome/lib64/gedit/plugins/snippets/windowactivatable.py", line 29 in <module>
    class Activate(Gedit.Message):
  • File "/opt/gnome/lib64/python2.7/site-packages/gi/types.py", line 208 in __init__
    super(GObjectMeta, cls).__init__(name, bases, dict_)
  • File "/opt/gnome/lib64/python2.7/site-packages/gi/_gobject/__init__.py", line 64 in __init__
    cls._install_properties()
  • File "/opt/gnome/lib64/python2.7/site-packages/gi/_gobject/__init__.py", line 76 in _install_properties
    gproperties[name] = prop.get_pspec_args()
  • File "/opt/gnome/lib64/python2.7/site-packages/gi/_gobject/propertyhelper.py", line 310 in get_pspec_args
    raise NotImplementedError(ptype)
NotImplementedError: <GType GtkTextIter (11078080)>

Comment 4 Timo Vanwynsberghe 2011-10-04 09:17:16 UTC
Created attachment 198204 [details] [review]
Allow GBoxed types as property

This should be the correct patch. Tested on Ubuntu 11.10 which includes a very recent version of PyGobject.
Comment 5 Ignacio Casal Quinteiro (nacho) 2011-10-04 10:31:56 UTC
Review of attachment 198204 [details] [review]:

Looks good to me too. You need an ack from J5 or tomeu too. Maybe provide an unit test for it?
Comment 6 Tomeu Vizoso 2011-10-05 10:30:29 UTC
Testing setting and getting such a property is needed so we don't regress. Once you have such a test case, run "make check-valgrind" and check this doesn't introduce memory errors.
Comment 7 Ignacio Casal Quinteiro (nacho) 2011-10-08 09:48:39 UTC
Created attachment 198592 [details] [review]
boxed tests

And here it is the tests for it.
Comment 8 Ignacio Casal Quinteiro (nacho) 2011-10-10 09:27:07 UTC
I pushed http://git.gnome.org/browse/pygobject/commit/?id=bef8d385117dd0295c9ba7567710d76fc2bb729a which uses GRegex instead of Gtk.TextIter.
Comment 9 Ignacio Casal Quinteiro (nacho) 2011-10-10 09:27:16 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.