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 625096 - WebKit class wrapped incorrectly
WebKit class wrapped incorrectly
Status: RESOLVED NOTGNOME
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2010-07-23 08:17 UTC by Lucian
Modified: 2010-07-30 13:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Snipped from WebKit's .gir file (6.37 KB, application/xml)
2010-07-27 15:59 UTC, Lucian
Details

Description Lucian 2010-07-23 08:17:23 UTC
>>> from gi.repository import Gtk, WebKit
>>> Gtk.Window()
<Window object at 0x7fb3a6093960 (GtkWindow at 0x1efd400)>
>>> WebKit.WebView()
<WebView object at 0x7fb3a609a280 (WebKitWebView at 0x1f95000)>
>>> WebKit.WebView().get_back_forward_list()
<__main__.WebKitWebBackForwardList object at 0x7fb3a609a6e0 (WebKitWebBackForwardList at 0x1fa4100)>
>>> WebKit.WebView().get_back_forward_list().get_back_length()
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
AttributeError: '__main__.WebKitWebBackForwardList' object has no attribute 'get_back_length'
>>> WebKit.WebBackFowardList
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lucian/pygi-0.6.0/gi/module.py", line 87, in __getattr__
    self.__class__.__name__, name))
AttributeError: 'DynamicModule' object has no attribute 'WebBackFowardList'


As you can see, that class is missing from the WebKit module and the object returned by get_back_forward_list is not backed by it (hence no methods).
Comment 1 Lucian 2010-07-23 08:17:54 UTC
Forgot to add, i'm using PyGI 0.6.0.
Comment 2 Lucian 2010-07-23 08:21:30 UTC
Typo.

>>> WebKit.WebBackForwardList
<class 'gi.types.__main__.WebKitWebBackForwardList'>

But the object returned by get_back_forward_list still has no methods.
Comment 3 Tomeu Vizoso 2010-07-26 12:06:02 UTC
(In reply to comment #2)
> Typo.
> 
> >>> WebKit.WebBackForwardList
> <class 'gi.types.__main__.WebKitWebBackForwardList'>
> 
> But the object returned by get_back_forward_list still has no methods.

Do the methods appear in the .gir file? There's a big chance the problem is in gobject-introspection and not pygobject.
Comment 4 Lucian 2010-07-27 12:54:05 UTC
I've built pygobject and webkit in jhbuild. Now WebBackForwardList does have methods, but it's missing a few, most notably get_back_list_with_limit and get_forward_list_with_limit.

Checking the .gir file, the WebBackForwardList has all the methods listed in the API reference, including get_back_list_with_limit and get_forward_list_with_limit.
Comment 5 Lucian 2010-07-27 15:59:12 UTC
Created attachment 166657 [details]
Snipped from WebKit's .gir file

Contains the relevant WebBackForwardList class and its methods.
Comment 6 Lucian 2010-07-27 16:04:37 UTC
Here's a list of methods from the python object

>>> h = WebKit.WebBackForwardList()
>>> h
<WebBackForwardList object at 0x8800cd4 (WebKitWebBackForwardList at 0x880d590)>
>>> dir(h)
['__class__', '__cmp__', '__copy__', '__deepcopy__', '__delattr__', '__dict__', '__doc__', '__format__', '__gdoc__', '__getattribute__', '__gobject_init__', '__grefcount__', '__gtype__', '__hash__', '__info__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'add_item', 'chain', 'clear', 'connect', 'connect_after', 'connect_object', 'connect_object_after', 'contains_item', 'disconnect', 'disconnect_by_func', 'emit', 'emit_stop_by_name', 'freeze_notify', 'get_back_item', 'get_back_length', 'get_current_item', 'get_data', 'get_forward_item', 'get_forward_length', 'get_limit', 'get_nth_item', 'get_properties', 'get_property', 'go_back', 'go_forward', 'go_to_item', 'handler_block', 'handler_block_by_func', 'handler_disconnect', 'handler_is_connected', 'handler_unblock', 'handler_unblock_by_func', 'new_with_web_view', 'notify', 'parent_instance', 'priv', 'props', 'set_data', 'set_limit', 'set_properties', 'set_property', 'stop_emission', 'thaw_notify', 'weak_ref']

No methods other than get_back_list_with_limit and get_forward_list_with_limit seem to be missing.

It seems that the issue is indeed with WebKit, the two methods have the attributes introspectable="0".
Comment 7 Tomeu Vizoso 2010-07-30 13:00:09 UTC
(In reply to comment #6)
> 
> It seems that the issue is indeed with WebKit, the two methods have the
> attributes introspectable="0".

In this case this ticket should be closed (and reopened later if the bug turns out to be in gobject-introspection).