(self, enable=True, pac=CORP_PROXY)
return result
Set proxy autoconfig.
Set proxy autoconfig.
Set proxy autoconfig .
def SetProxy(self, enable=True, pac=CORP_PROXY):
    """Set proxy autoconfig."""

    proxies = NSMutableDictionary.dictionaryWithDictionary_(
        self.ReadProxySettings())
    logging.debug('initial proxy settings: %s', proxies)
    proxies['ProxyAutoConfigURLString'] = pac
    if enable:
      proxies['ProxyAutoConfigEnable'] = 1
    else:
      proxies['ProxyAutoConfigEnable'] = 0
    logging.debug('Setting ProxyAutoConfigURLString to %s and '
                  'ProxyAutoConfigEnable to %s', pac, enable)
    result = SCDynamicStoreSetValue(self.store,
                                    'State:/Network/Global/Proxies',
                                    proxies)
    logging.debug('final proxy settings: %s', self.ReadProxySettings())
    return result
def SetProxy ( self , enable = True , pac = CORP_PROXY ) : proxies = NSMutableDictionary . dictionaryWithDictionary_ ( self . ReadProxySettings ( ) ) logging . debug ( 'initial proxy settings: %s' , proxies ) proxies [ 'ProxyAutoConfigURLString' ] = pac if enable : proxies [ 'ProxyAutoConfigEnable' ] = 1 else : proxies [ 'ProxyAutoConfigEnable' ] = 0 logging . debug ( 'Setting ProxyAutoConfigURLString to %s and ' 'ProxyAutoConfigEnable to %s' , pac , enable ) result = SCDynamicStoreSetValue ( self . store , 'State:/Network/Global/Proxies' , proxies ) logging . debug ( 'final proxy settings: %s' , self . ReadProxySettings ( ) ) return result