diff -ruN gwibber-2.29.92.1.old/gwibber/microblog/network.py gwibber-2.29.92.1/gwibber/microblog/network.py --- gwibber-2.29.92.1.old/gwibber/microblog/network.py 2010-03-24 17:48:50.909059359 +0200 +++ gwibber-2.29.92.1/gwibber/microblog/network.py 2010-03-24 17:54:54.417058838 +0200 @@ -1,6 +1,6 @@ #!/usr/bin/env python -import urllib, pycurl, json, StringIO +import urllib, pycurl, json, StringIO, gconf import traceback from util import log from util import exceptions @@ -8,6 +8,19 @@ class CurlDownloader: def __init__(self, url, params=None, post=False, username=None, password=None): self.curl = pycurl.Curl() + + self.gconf_client = gconf.client_get_default() + self.use_http_proxy = self.gconf_client.get_bool("/system/http_proxy/use_http_proxy") + if(self.use_http_proxy): + self.use_http_authentification = self.gconf_client.get_bool("/system/http_proxy/use_authentification") + if(self.use_http_authentification): + self.http_proxy_user = self.gconf_client.get_string("/system/http_proxy/authentication_user") + self.http_proxy_password = self.gconf_client.get_string("/system/http_proxy/authentication_password") + self.curl.setopt(pycurl.PROXYUSERPWD, self.http_proxy_user + ":" + self.http_proxy_password) + self.curl.setopt(pycurl.PROXYAUTH, ["CURLAUTH_ANY"]) + self.http_proxy_host = self.gconf_client.get_string("/system/http_proxy/host") + self.http_proxy_port = self.gconf_client.get_int("/system/http_proxy/port") + self.curl.setopt(pycurl.PROXY, self.http_proxy_host + ":" + str(self.http_proxy_port)) if params: if post: