[Sugar-devel] [PATCH] Browse added proxy support with http_proxy variable

Manuel Quiñones manuq at laptop.org
Fri Jan 4 17:03:33 EST 2013


Hi Ariel,

I guess this replace your previous email with subject "Patch 1/3".  I
have commented in that one.

2013/1/2 Ariel Calzada <ariel.calzada at gmail.com>:
> From: Ariel Calzada <aricalso at 000PaRaDoX000.(none)>
>
> This patch adds support for proxy in the Browse activity.
> Honors the variable http_proxy
>
> ---
>  webactivity.py |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/webactivity.py b/webactivity.py
> index d140128..5ae0358 100644
> --- a/webactivity.py
> +++ b/webactivity.py
> @@ -157,6 +157,11 @@ class WebActivity(activity.Activity):
>          session = WebKit.get_default_session()
>          session.set_property('accept-language-auto', True)
>
> +        # Honor the http_proxy variable
> +        if os.environ.get('http_proxy') is not None:
> +            proxy_uri = Soup.URI.new(os.environ['http_proxy'])
> +            session.set_property("proxy-uri",proxy_uri)
> +
>          # By default, cookies are not stored persistently, we have to
>          # add a cookie jar so that they get saved to disk.  We use one
>          # with a SQlite database:
> --
> 1.7.10.4
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel



-- 
.. manuq ..


More information about the Sugar-devel mailing list