~ubuntu-core-dev/update-manager/main

« back to all changes in this revision

Viewing changes to UpdateManager/Core/utils.py

  • Committer: Michael Vogt
  • Date: 2011-07-07 16:17:53 UTC
  • mto: This revision was merged to the branch mainline in revision 2148.
  • Revision ID: michael.vogt@ubuntu.com-20110707161753-gpybe06i2gx71gtl
initial port from gconf -> gsettings, this needs some cleanup in the naming still

Show diffs side-by-side

added added

removed removed

Lines of Context:
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)
248
 
  # then gconf
249
 
  elif gconfclient:
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")
255
 
        if host and port:
256
 
          if use_auth:
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)
260
 
          else:
261
 
            proxy = "http://%s:%s/" % (host, port)
262
 
    except Exception, e:
263
 
      print "error from gconf: %s" % e
 
248
  # gconf is no more
 
249
  # elif gconfclient:
 
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")
 
255
  #       if host and port:
 
256
  #         if use_auth:
 
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)
 
260
  #         else:
 
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
265
265
  if proxy:
266
266
    # basic verification