[Sugar-devel] webkit, hulahop; developing apps using browser engine DOM for widgets

Bobby Powers bobbypowers at gmail.com
Tue Jun 9 19:18:59 EDT 2009


Hi Luke

On Tue, Jun 9, 2009 at 5:08 PM, Luke Kenneth Casson
Leighton<lkcl at lkcl.net> wrote:
> folks, hi,
> i might have mentioned some of this before, but wanted to emphasise a
> few things - please bear with me if you've heard some of it before.
> i'd been looking for python bindings to DOM model browser technology
> for quite some time, and _eventually_ found it, in the most unlikely
> of places, in hulahop.  but - before i found that, i had had to go
> through the whole rigmarole of adding glib / gobject bindings to
> webkit, and work also on pywebkitgtk to add python bindings to _those_
> bindings.
>
> so i just wanted to ask: do you _know_ how many people have been
> looking, for years, for python bindings to XUL?  are you _aware_ how
> powerful and how under-appreciated hulahop is? :)  the mozilla mailing
> lists and other mailing lists are stuffed with unanswered questions
> dating back to 2006, "how do i use python-xpdom to actually _do_
> anything???" and you guys just made it... dead-easy.
>
> i've created a small sample, here:
> http://lkcl.net/pyjamas/pyjamas-xpdom.tgz
>
> run python ./hula.py and it will build a web page purely using DOM
> manipulation in python and also turn the body background green - again
> using DOM manipulation of the body CSS stylesheet.  also i think i did
> an event click listener (ContentInvoker) because those are quite
> tricky to get right.
>
> rather painfully, i had to add a timer delay in order to let the page
> settle down (with a blank page) otherwise the DOM isn't ready /
> initialised - i couldn't work out any other way of doing this but i
> understand vaguely what's going on.
>
> anyway - one thing i _did_ specifically want to mention is that i
> _did_ notice the similarity between the olpc "browser" and the
> pywebkitgtk "demobrowser.py" and the copyright notice in
> demobrowser.py i had noticed mentioned olpc.
>
> i can understand why you abandoned webkit and went for python-xpdom:
> adding glib/gobject bindings to webkit was a _massive_ one-off
> undertaking but, it's done!
> http://github.com/lkcl/webkit/16401.master you can get the source there.

Actually, I believe Jan, the pywebkitgtk maintainer, started off with
OLPC's Browse activity for that demo.  He then modified it to use the
new webkit bindings instead of hulahop ones.  OLPC has always used
hulahop, although I worked a little on a proof of concept browser
activity using webkit a few months ago (
http://git.sugarlabs.org/projects/browse/repos/webkit ).  The problem
was that at the time, none of the packages in Ubuntu/Fedora/Debian
included the new gobject download API, so it was of limited usability.
 The situation should be better now, I just haven't gotten back to it
it.  'patches welcome' :)

bobby

> so - the things that were missing from webkit (decent python bindings
> which include DOM-level manipulation) are now available, and you
> could, conceivably, replace XUL with webkit, and still have the level
> of functionality that is available, now (he said... :)
>
> lastly i just want to emphasise that if you look at e.g.
> pyjamas-desktop http://pyjd.org you can see that it is possible to
> create an entire desktop widget set API on top of this browser
> technology, that is actually independent of the browser technology
> implementation: it doesn't matter if it's KHTML, xpdom/hulahop or
> pywebkitgtk.  and it's clear that browser technology makes for a
> better desktop widget set API than desktop widget set APIs do.  gtk
> and qt4 are _crap_ by comparison.
>
> .... that's all :)
>
> l.
>
> oh - btw: if anyone's going to be at europython.eu 2009 do say hello,
> i'll be happy to explain more.
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>


More information about the Sugar-devel mailing list