Merge lp:~allsymes/software-center/http_proxy into lp:software-center

Proposed by Luke Symes
Status: Merged
Merged at revision: not available
Proposed branch: lp:~allsymes/software-center/http_proxy
Merge into: lp:software-center
Diff against target: 37 lines (+12/-2)
2 files modified
softwarecenter/backend/aptd.py (+6/-1)
softwarecenter/view/widgets/imagedialog.py (+6/-1)
To merge this branch: bzr merge lp:~allsymes/software-center/http_proxy
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Review via email: mp+14575@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Luke Symes (allsymes) wrote :

Enables proxy authentication for those who need it, specifically for downloading packages and screenshots.

Revision history for this message
Michael Vogt (mvo) wrote :

Merged (with minor adjustments)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/backend/aptd.py'
--- softwarecenter/backend/aptd.py 2009-11-04 09:51:35 +0000
+++ softwarecenter/backend/aptd.py 2009-11-07 02:55:18 +0000
@@ -168,7 +168,12 @@
168 if client.get_bool("/system/http_proxy/use_http_proxy"):168 if client.get_bool("/system/http_proxy/use_http_proxy"):
169 host = client.get_string("/system/http_proxy/host")169 host = client.get_string("/system/http_proxy/host")
170 port = client.get_int("/system/http_proxy/port")170 port = client.get_int("/system/http_proxy/port")
171 transaction.set_http_proxy("http://%s:%s/" % (host, port))171 authentication = ""
172 if client.get_bool("/system/http_proxy/use_authentication"):
173 user = client.get_string("/system/http_proxy/authentication_user")
174 password = client.get_string("/system/http_proxy/authentication_password")
175 authentication = "%s:%s@" % (user, password)
176 transaction.set_http_proxy("http://%s%s:%s/" % (authentication, host, port))
172 except:177 except:
173 logging.exception("gconf http proxy failed")178 logging.exception("gconf http proxy failed")
174179
175180
=== modified file 'softwarecenter/view/widgets/imagedialog.py'
--- softwarecenter/view/widgets/imagedialog.py 2009-10-15 16:07:37 +0000
+++ softwarecenter/view/widgets/imagedialog.py 2009-11-07 02:55:18 +0000
@@ -40,9 +40,14 @@
40 client = gconf.client_get_default()40 client = gconf.client_get_default()
41 if client.get_bool("/system/http_proxy/use_http_proxy"):41 if client.get_bool("/system/http_proxy/use_http_proxy"):
42 try:42 try:
43 authentication = ""
44 if client.get_bool("/system/http_proxy/use_authentication"):
45 user = client.get_string("/system/http_proxy/authentication_user")
46 password = client.get_string("/system/http_proxy/authentication_password")
47 authentication = "%s:%s@" % (user, password)
43 host = client.get_string("/system/http_proxy/host")48 host = client.get_string("/system/http_proxy/host")
44 port = client.get_int("/system/http_proxy/port")49 port = client.get_int("/system/http_proxy/port")
45 proxies = { "http" : "http://%s:%s/" % (host, port) }50 proxies = { "http" : "http://%s%s:%s/" % (authentication, host, port) }
46 except GError, e:51 except GError, e:
47 pass52 pass
48 urllib.FancyURLopener.__init__(self, proxies)53 urllib.FancyURLopener.__init__(self, proxies)