I added a return to the begining of the addWindowListener function and it
skipped that error
and hit another similar to the last one
I made a couple of more fixes. I got the error below
init <pyjs.runners.giwebkit.RunnerContext object at 0x10a0699d0> True
Traceback (most recent call last):
File "KitchenSink.py", line 117, in <module>
pyjd.setup("public/KitchenSink.html")
File "/Users/sarvi/Workspace/pyjs/pyjs/runners/__init__.py", line 68, in
setup
listener()
File "/Users/sarvi/Workspace/pyjs/pyjswidgets/pyjamas/History.py", line
109, in init
hash = wnd().location.hash
File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 408, in
__call__
return self.getattr(inst, key)
File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 413, in
getattr
attr = impl(inst, key)
File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 423, in
getattr_gi
if inst.get_data(key) is None:
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gi/overrides/GObject.py",
line 590, in _unsupported_data_method
raise RuntimeError('Data access methods are unsupported. '
RuntimeError: Data access methods are unsupported. Use normal Python
attributes instead
And made a change to hasattr() along the same lines as your suggestion
above.
Then I got the following
File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 438, in
getattr_w3
attr = self._custom[key].bind(key)
File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 360, in
bind
return types.MethodType(cls(key), None, owner)
File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 328, in
__init__
Soup.URI.new()
TypeError: new() takes exactly 1 argument (0 given)
I just changed that to take Scoup.URI.new('http://www.google.com')
and then I hit this
File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 438, in
getattr_w3
attr = self._custom[key].bind(key)
File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 360, in
bind
return types.MethodType(cls(key), None, owner)
File "/Users/sarvi/Workspace/pyjs/pyjs/runners/giwebkit.py", line 332, in
__init__
doc = app._doc
NameError: global name 'app' is not defined
When I was looking through, I am not sure I understand how this code has
been working so far, coz "app" is not
defined gloablly.
What am I missing.
I could wait for you to finish up the addEventListener, but I suspect thats
not gonna address any of this.
So let me know if it is helpful for me to pursue this.
Sarvi
On Thursday, October 17, 2013 11:24:43 AM UTC-7, C Anthony Risinger wrote:
>
> On Oct 17, 2013 12:17 PM, "Sarvi Shanmugham" <[email protected]<javascript:>>
> wrote:
> >
> > 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
>
> Yep, this is the remaining thing that I have to implement via ctypes...
> the method is defined in the underlying gobject api, but since WebKitGTK
> authors did not add a GNotify callback to the signature, or use a GClosure,
> the introspection stuff is unable to automatically generate a non-leaky
> binding... therefore it gets skipped altogether.
>
> If you just change the function to skip that stuff (possibly by just
> `pass`ing it entirely), you should be able to run most if not all
> examples... event handling won't work, but it should still construct the
> DOM.
>
> I plan to wrap up the ctypes stuff over the weekend... I'll be at the
> in-laws house with my chromebook, but VPN+SSH usually let's me work all the
> same.
>
> --
>
> C Anthony [mobile]
>
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.