[Sugar-devel] web-activity: env.getEnvironment dependency with Python code

Rogelio Mita rogeliomita at activitycentral.com
Tue Nov 26 23:31:45 EST 2013


I noticed existence of a WebKitWebView event which is emitted before what
any resource be loaded, called
webkit_loaded_started<http://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WEBKIT-LOAD-STARTED:CAPS>

> WEBKIT_LOAD_STARTED: A new load request has been made. No data has been
> received yet, empty structures have been allocated to perform the load; the
> load may still fail due to transport issues such as not being able to
> resolve a name, or connect to a port.

I did a concept proof on sugar-toolkit-gtk3 to show this behaviour and the
result was:

[image: Imágenes integradas 1]

I think that this behaviour can solve the issue with env.getEnvironment and
your hard dependency with sugar var provided by python code.

This log also show how load_event_finished is executed between successive
requests, then there is no doubt about the current problem existence.

You think this may be a solution?, change the script so that it is now run
in this event (load_event_started) and rewrite getEnvironment disregarding
the possibility that there is no environment variable provided by the
Python code, in others words ever when activity is in sugar mode,
window.sugar.environment will be present


-- 
Roger

Activity Central <http://activitycentral.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20131127/3f449ca1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 149292 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20131127/3f449ca1/attachment-0001.png>


More information about the Sugar-devel mailing list