Ticket #3262: dex-session.diff

File dex-session.diff, 1.5 KB (added by JerryV, 12 years ago)

sugar-session diff

  • sugar-session

    old new  
    22# Copyright (C) 2006, Red Hat, Inc.
    33# Copyright (C) 2009, One Laptop Per Child Association Inc
    44# Copyright (C) 2010, Plan Ceibal <comunidad@plan.ceibal.edu.uy>
     5# Copyright (C) 2011, OLPC-AU.
    56#
    67# This program is free software; you can redistribute it and/or modify
    78# it under the terms of the GNU General Public License as published by
     
    253254    if timezone is not None and timezone:
    254255        os.environ['TZ'] = timezone
    255256
     257    ## JV export http_proxy from .gconf 
     258    sys_dir = '/system/http_proxy'
     259    client = gconf.client_get_default()
     260    use_proxy = client.get_string('/system/proxy/mode')
     261    if use_proxy != 'none':
     262        http_host = client.get_string('%s/host' % sys_dir)
     263        http_port = client.get_int('%s/port' % sys_dir)
     264        use_auth = client.get_bool('%s/use_authentication' % sys_dir)
     265        proxy_string = '%s:%d' % (http_host, http_port)
     266        if use_auth is True:
     267            auth_user = client.get_string('%s/authentication_user' % sys_dir)
     268            auth_pass = client.get_string('%s/authentication_password' % sys_dir)
     269            proxy_info = '%s:%s@%s' % (auth_user, auth_pass, proxy_string)
     270        else:
     271            proxy_info = proxy_string
     272        os.environ['http_proxy'] = 'http://%s' % proxy_info
     273    else:
     274        pass
     275 
    256276    set_fonts()
    257277
    258278    # this must be added early, so that it executes and unfreezes the screen