From cab619af6ad5ce8f2ed9d599e54bfad8d57c3f60 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 6 Oct 2006 15:32:03 +0200 Subject: * UpdateManager/UpdateManager.py: - fix proxy usage (fetch it from gconf) --- UpdateManager/UpdateManager.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'UpdateManager/UpdateManager.py') diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index ab1d8a95..6fed3517 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -383,10 +383,27 @@ class UpdateManager(SimpleGladeApp): self.button_help.set_sensitive(False) self.gconfclient = gconf.client_get_default() + self.init_proxy() + # restore state self.restore_state() self.window_main.show() + def init_proxy(self): + if os.getenv("http_proxy"): + return + if self.gconfclient.get_bool("/system/http_proxy/use_http_proxy"): + host = self.gconfclient.get_string("/system/http_proxy/host") + port = self.gconfclient.get_int("/system/http_proxy/port") + use_auth = self.gconfclient.get_bool("/system/http_proxy/use_authentication") + if use_auth: + auth_user = self.gconfclient.get_string("/system/http_proxy/authentication_user") + auth_pw = self.gconfclient.get_string("/system/http_proxy/authentication_password") + proxy = "http://%s:%s@%s:%s/" % (auth_user,auth_pass,host, port) + else: + proxy = "http://%s:%s/" % (host, port) + os.putenv("http_proxy",proxy) + def header_column_func(self, cell_layout, renderer, model, iter): pkg = model.get_value(iter, LIST_PKG) if pkg == None: @@ -836,7 +853,7 @@ class UpdateManager(SimpleGladeApp): dialog.set_markup(msg) dialog.run() dialog.destroy() - + def on_button_dist_upgrade_clicked(self, button): #print "on_button_dist_upgrade_clicked" fetcher = DistUpgradeFetcher(self, self.new_dist) -- cgit v1.2.3