<div dir="ltr"><div><div><div>Hi all,<br></div><div><br></div>The proxy feature implementation looks complete now. <a href="https://github.com/sugarlabs/sugar/pull/665">https://github.com/sugarlabs/sugar/pull/665</a><br><br></div>Hence, please review it and provide suggestions. :)<br><br></div><div>Shall I update the feature page for the same? <a href="https://wiki.sugarlabs.org/go/Features/Proxy_Settings">https://wiki.sugarlabs.org/go/Features/Proxy_Settings</a><br><br></div><div>Thanks.<br></div><div>Regards<br><br></div><div>Manash Pratim Das (ManashRaja)<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 16, 2016 at 3:27 AM, James Cameron <span dir="ltr"><<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Mar 16, 2016 at 01:57:06AM +0530, Manash Raja wrote:<br>
> Dear James,<br>
><br>
> Regarding moving to src/jarabe/main.py , as far as I know, there<br>
> isn't a direct way for python to set the required environment<br>
> variables (http_proxy) and make it accessible to all other<br>
> processes. The various method in python for editing the environment<br>
> variables, keeps the changes limited to only that process or its<br>
> child processes. Hence if the implementation is done through<br>
> main.py, other files to run bash scripts have to be introduced.<br>
<br>
</span>I disagree.  src/jarabe/main.py already sets several environment<br>
variables that are inherited by activity processes, so there is no<br>
need to run shell scripts.  You should test again.  Take particular<br>
note of variables such as SUGAR_VERSION, and TZ.<br>
<br>
SUGAR_VERSION is set during startup with this;<br>
<br>
os.environ['SUGAR_VERSION'] = config.version<br>
<br>
TZ is set by reading a Gio.Settings instance with this;<br>
<br>
def setup_timezone():<br>
    settings = Gio.Settings('org.sugarlabs.date')<br>
    timezone = settings.get_string('timezone')<br>
    if timezone is not None and timezone:<br>
        os.environ['TZ'] = timezone<br>
<br>
There is no benefit to using /usr/bin/sugar instead, and your proposed<br>
change is very resource intensive because of multiple activation of<br>
gsettings binary.<br>
<span class=""><br>
> So, to me it seems exporting proxy settings to the environment<br>
> variables at /usr/bin/sugar is a fine implementation. Though we can<br>
> use variables to reduce gsettings calls in that file.<br>
><br>
> I would definitely look at the branch based development from next time.<br>
><br>
> Tell me if I shall reduce gsettings call in /usr/bin/sugar file and continue<br>
> with the present implementation or look for any other implementation that you<br>
> suggest. Once the feature is final for merge, I will collapse/rebase the<br>
> commits with new commit message and update the PR.<br>
><br>
> Thanks.<br>
><br>
> Regards.<br>
> Manash Pratim Das (ManashRaja)<br>
><br>
</span><span class="">> On Tue, Mar 15, 2016 at 10:39 AM, James Cameron <[1]<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>> wrote:<br>
><br>
>     Thanks, that's interesting.<br>
><br>
</span>>     Your /usr/bin/sugar (aka bin/[2]<a href="http://sugar.in" rel="noreferrer" target="_blank">sugar.in</a>) will run gsettings many times,<br>
<span class="">>     and this is inefficient, causing unnecessary delay during startup.<br>
>     Perhaps if you move this into src/jarabe/main.py which already uses<br>
>     Gio.Settings?<br>
><br>
>     You have worked on your master branch and the pull request is<br>
>     associated with that branch.  That's unusual.  It is more common to<br>
>     use a new branch with a name that explains the feature.  Make a note<br>
>     of that for next time.<br>
><br>
>     Your pull request has three commits; 09d363f, 682d0b2, 4fe1a2f.<br>
>     Before merging, we will ask for these and later commits to be<br>
>     collapsed, rebased, or re-written.  You may also combine and rewrite<br>
>     the commit messages.  Then a push with --force will update the pull<br>
>     request.<br>
><br>
</span>>     The [3]<a href="http://wiki.sugarlabs.org/go/Features/Proxy_Settings" rel="noreferrer" target="_blank">http://wiki.sugarlabs.org/go/Features/Proxy_Settings</a> page is on a<br>
<div><div class="h5">>     Wiki, and any change can be rolled back.<br>
><br>
>     On Tue, Mar 15, 2016 at 09:58:31AM +0530, Manash Raja wrote:<br>
>     > Hi,<br>
>     ><br>
>     > I thank you all for the guidance.<br>
>     ><br>
>     > I modified my PR as per your suggestions and now the implementation of<br>
>     the<br>
>     > proxy feature is far better.<br>
>     > @Sam, as you suggested, I have now completely removed the need of<br>
>     re-writing<br>
>     > "proxy.sh" every time the settings changes and am using<br>
>     > "org.gnome.system.proxy" schemas. Now "/usr/bin/sugar" is hard-coded to<br>
>     read<br>
>     > the proxy settings from "org.gnome.system.proxy" and export it to the<br>
>     > environment variables required for the proxy settings to be available<br>
>     easily.<br>
>     ><br>
>     > @Gonzalo, thanks for the link to that important patch from Manuel<br>
>     Quiñones. And<br>
>     > @James, I have changed my "view.py" and "model.py" files to go with <br>
>     Manuel<br>
>     > Quiñones' way of setting the "org.gnome.system.proxy" schemas via<br>
>     GSettings.<br>
>     > This has hence removed the dependence on polkit for file write<br>
>     permissions and<br>
>     > made us do away with extra files like "set_proxy.py" for running root<br>
>     permitted<br>
>     > scripts.<br>
>     ><br>
>     > Also I have removed the "logout.sh" script as now I am using the pre-made<br>
>     > "require-restart" feature present in "sectionview" which asks the user<br>
>     for<br>
>     > restart.<br>
>     ><br>
>     > Also @James, shall I now therefore submit the GUI changes and the changes<br>
>     you<br>
</div></div>>     > proposed to for this update in the features page? [1][4]<br>
>     <a href="http://wiki.sugarlabs.org/go/" rel="noreferrer" target="_blank">wiki.sugarlabs.org/go/</a><br>
>     > Features/Proxy_Settings<br>
>     ><br>
>     > Here is the patch I submitted: [2][5]<a href="https://github.com/ManashRaja/sugar/" rel="noreferrer" target="_blank">https://github.com/ManashRaja/sugar/</a><br>
<span class="">>     commit/<br>
>     > 4fe1a2fea7f37d036331c1a1ae736c88cc29d62d<br>
>     ><br>
>     > Thanks<br>
>     > Regards<br>
>     > Manash Pratim Das<br>
>     ><br>
</span>>     > On Mon, Mar 14, 2016 at 8:03 AM, James Cameron <[3][6]<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>><br>
<span class="">>     wrote:<br>
>     ><br>
>     >     On Sun, Mar 13, 2016 at 11:18:46PM -0300, Gonzalo Odiard wrote:<br>
</span>>     >     > On Sun, Mar 13, 2016 at 11:09 PM, Jerry Vonau <[1][4][7]<br>
<span class="">>     <a href="mailto:me@jvonau.ca">me@jvonau.ca</a>> wrote:<br>
>     >     ><br>
>     >     > > Yea that has roots to the old ActivityCentral fork, any reason<br>
>     >     > > why this has not been 'upstreamed' from OneEducation(OLPC-AU) to<br>
>     >     > > SugarLabs?<br>
>     >     ><br>
>     >     > Yes. Was not accepted by sugar upstream.<br>
>     ><br>
>     >     Let's have another go then.  See what the objections are from the<br>
>     >     current set of developers.<br>
>     ><br>
>     >     > I upstreamed all that was possible, the only changes that were<br>
>     >     > developed just for OLPC-AU were the changes needed to deal with the<br>
>     >     > complex network environments common in Australian schools.<br>
>     ><br>
>     >     This disease is spreading.<br>
>     ><br>
>     >     --<br>
>     >     James Cameron<br>
</span>>     >     [5][8]<a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
>     >     _______________________________________________<br>
>     >     Sugar-devel mailing list<br>
>     >     [6][9]<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
>     >     [7][10]<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" rel="noreferrer" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
>     ><br>
>     > References:<br>
>     ><br>
>     > [1] [11]<a href="http://wiki.sugarlabs.org/go/Features/Proxy_Settings" rel="noreferrer" target="_blank">http://wiki.sugarlabs.org/go/Features/Proxy_Settings</a><br>
>     > [2] [12]<a href="https://github.com/ManashRaja/sugar/commit/" rel="noreferrer" target="_blank">https://github.com/ManashRaja/sugar/commit/</a><br>
>     4fe1a2fea7f37d036331c1a1ae736c88cc29d62d<br>
>     > [3] mailto:[13]<a href="mailto:quozl@laptop.org">quozl@laptop.org</a><br>
>     > [4] mailto:[14]<a href="mailto:me@jvonau.ca">me@jvonau.ca</a><br>
>     > [5] [15]<a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
>     > [6] mailto:[16]<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
>     > [7] [17]<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" rel="noreferrer" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
><br>
>     --<br>
>     James Cameron<br>
>     [18]<a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
><br>
> References:<br>
><br>
> [1] mailto:<a href="mailto:quozl@laptop.org">quozl@laptop.org</a><br>
> [2] <a href="http://sugar.in/" rel="noreferrer" target="_blank">http://sugar.in/</a><br>
> [3] <a href="http://wiki.sugarlabs.org/go/Features/Proxy_Settings" rel="noreferrer" target="_blank">http://wiki.sugarlabs.org/go/Features/Proxy_Settings</a><br>
> [4] <a href="http://wiki.sugarlabs.org/go/" rel="noreferrer" target="_blank">http://wiki.sugarlabs.org/go/</a><br>
> [5] <a href="https://github.com/ManashRaja/sugar/commit/" rel="noreferrer" target="_blank">https://github.com/ManashRaja/sugar/commit/</a><br>
> [6] mailto:<a href="mailto:quozl@laptop.org">quozl@laptop.org</a><br>
> [7] mailto:<a href="mailto:me@jvonau.ca">me@jvonau.ca</a><br>
> [8] <a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
> [9] mailto:<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
> [10] <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" rel="noreferrer" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
> [11] <a href="http://wiki.sugarlabs.org/go/Features/Proxy_Settings" rel="noreferrer" target="_blank">http://wiki.sugarlabs.org/go/Features/Proxy_Settings</a><br>
> [12] <a href="https://github.com/ManashRaja/sugar/commit/4fe1a2fea7f37d036331c1a1ae736c88cc29d62d" rel="noreferrer" target="_blank">https://github.com/ManashRaja/sugar/commit/4fe1a2fea7f37d036331c1a1ae736c88cc29d62d</a><br>
> [13] mailto:<a href="mailto:quozl@laptop.org">quozl@laptop.org</a><br>
> [14] mailto:<a href="mailto:me@jvonau.ca">me@jvonau.ca</a><br>
> [15] <a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
> [16] mailto:<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
> [17] <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" rel="noreferrer" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
> [18] <a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
James Cameron<br>
<a href="http://quozl.netrek.org/" rel="noreferrer" target="_blank">http://quozl.netrek.org/</a><br>
</div></div></blockquote></div><br></div>