[Sugar-devel] sugar-web: env.js questions

Daniel Narvaez dwnarvaez at gmail.com
Fri Nov 22 13:56:25 EST 2013


On 22 November 2013 19:31, Rogelio Mita <rogeliomita at activitycentral.com>wrote:

> Hi,
>
> Can you help me to understand the getEnvironment function (
> https://github.com/sugarlabs/sugar-web/blob/master/env.js)?.
>

This is used to pass some initial environment variables from python.


> My understanding is that if sugar.environment is undefined is because I am
> in standalone mode, is that right?
>

Right now, I'd expect it to not return at all, which is a bug. I'm not sure
what's a good solution though, other than writing a webkit plugin in C
which I'm trying to resist.


> what is the purpose of this handler onEnvironmentSet (
> https://github.com/sugarlabs/sugar-web/blob/master/env.js#L22)?
>
>
Python calls it to notify js that it has set the environment variables on
window.sugar.


> I am running all tests (with karma but with a Chfome browser, no in sugar
> environment) and I noted some rare: when is running this test:
> https://github.com/sugarlabs/sugar-web/blob/master/test/envSpec.js is
> SUCCESS, I can't underestand why.
>

You mean it sometimes succeed or it rarely does? (both are unexpected).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20131122/eefedf4b/attachment.html>


More information about the Sugar-devel mailing list