[Sugar-devel] [IAEP] Tech roadmap

Daniel Narvaez dwnarvaez at gmail.com
Wed Nov 6 18:20:47 EST 2013


On 6 November 2013 18:32, Gonzalo Odiard <gonzalo at laptop.org> wrote:

> >> No. the web-server issue is already solved.
> >
> > If we want to support WebKit1, I think we should do it upstream then. I'm
> > still not thrilled about that but not opposed to it either.
>
> Good. We can see what is the better way to do it. May be check the
> webkit version installed?
>
> Just for reference, the changes we did are here:
>
>
> https://github.com/godiard/au1b_rpms/blob/master/sugar-toolkit-gtk3/0001-Adapt-webactivity-to-work-with-webkit1.patch
>

I think the best way to detect it would be to import WebKit2, if it fails
fall back to WebKit.

I'm not sure what's the best way to maintain the two different
implementations though. Maybe two modules with identical interfaces,
imported "as webview".

So something like this in webactivity.py:

try:
  from gi.repository import WebKit2
except ImportError:
  pass

if WebKit2:
  from sugar.activity import webkit1view as webview
else:
  from sugar.activity import webkit2view as webview

class WebActivity:
  def __init__(self):
    self._web_view = webview.WebView()
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20131107/5807eb65/attachment.html>


More information about the Sugar-devel mailing list