245
245
proxy_port = str(cnf.find_i("Synaptic::httpProxyPort"))
246
246
if proxy_host and proxy_port:
247
247
proxy = "http://%s:%s/" % (proxy_host, proxy_port)
250
try: # see LP: #281248
251
if gconfclient.get_bool("/system/http_proxy/use_http_proxy"):
252
host = gconfclient.get_string("/system/http_proxy/host")
253
port = gconfclient.get_int("/system/http_proxy/port")
254
use_auth = gconfclient.get_bool("/system/http_proxy/use_authentication")
257
auth_user = gconfclient.get_string("/system/http_proxy/authentication_user")
258
auth_pw = gconfclient.get_string("/system/http_proxy/authentication_password")
259
proxy = "http://%s:%s@%s:%s/" % (auth_user,auth_pw,host, port)
261
proxy = "http://%s:%s/" % (host, port)
263
print "error from gconf: %s" % e
250
# try: # see LP: #281248
251
# if gconfclient.get_bool("/system/http_proxy/use_http_proxy"):
252
# host = gconfclient.get_string("/system/http_proxy/host")
253
# port = gconfclient.get_int("/system/http_proxy/port")
254
# use_auth = gconfclient.get_bool("/system/http_proxy/use_authentication")
257
# auth_user = gconfclient.get_string("/system/http_proxy/authentication_user")
258
# auth_pw = gconfclient.get_string("/system/http_proxy/authentication_password")
259
# proxy = "http://%s:%s@%s:%s/" % (auth_user,auth_pw,host, port)
261
# proxy = "http://%s:%s/" % (host, port)
262
# except Exception, e:
263
# print "error from gconf: %s" % e
264
264
# if we have a proxy, set it
266
266
# basic verification