The second one got me pas that error and I hit the following which I 
suspect is related to the lack of EventListener support

DEBUG:pyjs.runners.giwebkit:sub-frame: <WebFrame object at 0x1510481e0 
(WebKitWebFrame at 0x7fbae4009840)>
Traceback (most recent call last):
  File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 603, in 
_frame_loaded_cb
    __pyjamas__.set_main_frame(self)
  File "/Users/sarvi/Workspace/pyjs/pyjswidgets/__pyjamas__.py", line 38, 
in set_main_frame
    DOM.init()
  File "/Users/sarvi/Workspace/pyjs/pyjswidgets/pyjamas/DOM.py", line 83, 
in init
    mf._addWindowEventListener("click", browser_event_cb)
  File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 687, in 
addWindowEventListener
    listener = WebKit.dom_create_event_listener(cb._callback, None)
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gi/module.py",
 
line 313, in __getattr__
    return getattr(self._introspection_module, name)
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gi/module.py",
 
line 134, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.WebKit' object has no attribute 
'dom_create_event_listener'

I don't see a dom_create_event_listener in the webkit DOMWindow.idl below
https://github.com/WebKit/webkit/blob/master/Source/WebCore/page/DOMWindow.idl

But I see this below. am I way off? where did you find the 
dom_create_event_listener?

    // EventTarget interface
    [Custom] void addEventListener(DOMString type,
                                  EventListener listener,
                                  optional boolean useCapture);
    [Custom] void removeEventListener(DOMString type,
                                      EventListener listener,
                                      optional boolean useCapture);
    [RaisesException] boolean dispatchEvent(Event evt);

    void captureEvents(/*in long eventFlags*/);
    void releaseEvents(/*in long eventFlags*/);

I read through some of your threads/bug to WebKit/Gobject introspection about 
adding addEventListener below. 
Is the above what you were looking for?

https://bugs.webkit.org/show_bug.cgi?id=77835

Sarvi

On Thursday, October 17, 2013 7:33:45 AM UTC-7, C Anthony Risinger wrote:
>
> On Thu, Oct 17, 2013 at 9:27 AM, C Anthony Risinger 
> <ant...@xtfx.me<javascript:>
> > wrote:
>
>> On Thu, Oct 17, 2013 at 4:50 AM, Sarvi Shanmugham 
>> <sarv...@gmail.com<javascript:>
>> > wrote:
>>  
>>> Found this
>>> http://comments.gmane.org/gmane.linux.laptop.olpc.sugar/39321
>>> https://bugzilla.gnome.org/show_bug.cgi?id=641944
>>>
>>> Which talks about the issue and a change in the gobject API
>>>
>>
>> ah dang, thanks for the link.
>>
>> i'll have to update the backend then... there wasn't a reason i used the 
>> set/get methods other than i thought they might be more stable...
>>
>> if you change:
>>
>>     def setattr(self, inst, key, attr):
>>
>>
>>         # hasattr() *specifically* chosen because it calls getattr()
>>
>>         # internally, possibly setting a proxy object; if True, super()
>>         # will then properly setattr() against the proxy or instance.
>>
>>
>>         if hasattr(inst, key):
>>             super(self._type_gi, inst).__setattr__(key, attr)
>>
>>
>>         else:
>>             inst.set_data(key, attr)
>>
>>
>>             logger.debug('setattr(inst, %r, attr):\n%s', key,
>>
>>
>>                 pformat([('inst', inst), ('attr', attr)]))
>>
>>
>>
>> ...to:
>>
>>
>>     def setattr(self, inst, key, attr):
>>
>>
>>         self.getattr(inst, key)
>>
>>         super(self._type_gi, inst).__setattr__(key, attr)
>>
>>
>>
>> ...i think it will probably work.
>>
>>
> sorry, you need to use hasattr(), in case the attr already existed: 
>
>
>
>     def setattr(self, inst, key, attr):
>
>         # hasattr() *specifically* chosen because it calls getattr()
>
>
>         # internally, possibly setting a proxy object; if True, super()
>         # will then properly setattr() against the proxy or instance.
>
>         hasattr(inst, key)
>
>         super(self._type_gi, inst).__setattr__(key, attr)
>
>
> ...the "empty" call to hasattr is purely to trigger the creation of a 
> proxy object, if need be.
>
> -- 
>
> C Anthony 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Pyjs.org Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyjs-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to