diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-10-06 15:32:03 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-10-06 15:32:03 +0200 |
| commit | cab619af6ad5ce8f2ed9d599e54bfad8d57c3f60 (patch) | |
| tree | 8206b64c73552d09fc07ed1834aa45c4803d448e /UpdateManager/UpdateManager.py | |
| parent | 6b4f894acf07ee65b217dcdff5366d2bf4912d94 (diff) | |
| download | python-apt-cab619af6ad5ce8f2ed9d599e54bfad8d57c3f60.tar.gz | |
* UpdateManager/UpdateManager.py:
- fix proxy usage (fetch it from gconf)
Diffstat (limited to 'UpdateManager/UpdateManager.py')
| -rw-r--r-- | UpdateManager/UpdateManager.py | 19 |
1 files changed, 18 insertions, 1 deletions
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) |
