(self, enable=True, pac=CORP_PROXY)
Sets the proxy autoconfiguration URL and enables or disables it.
Sets the proxy autoconfiguration URL and enables or disables it.
Sets the proxy autoconfiguration URL and enables or disables it .
def SetProxy(self, enable=True, pac=CORP_PROXY):
    """Sets the proxy autoconfiguration URL and enables or disables it."""
    interfaces = self.GetPathValue(u'/NetworkServices')
    for interface in interfaces:
      # Some interfaces, (e.g. some 3G modem dummy interfaces) don't
      # always have a proxy key, so we simply ignore them.
      if 'Proxies' not in interfaces[interface]:
        continue
      if enable:
        interfaces[interface]['Proxies']['ProxyAutoConfigEnable'] = 1
        interfaces[interface]['Proxies']['ProxyAutoConfigURLString'] = pac
      else:
        interfaces[interface]['Proxies']['ProxyAutoConfigEnable'] = 0

    self.SetPathValue(u'/NetworkServices', interfaces)
def SetProxy ( self , enable = True , pac = CORP_PROXY ) : interfaces = self . GetPathValue ( u'/NetworkServices' ) for interface in interfaces : # Some interfaces, (e.g. some 3G modem dummy interfaces) don't # always have a proxy key, so we simply ignore them. if 'Proxies' not in interfaces [ interface ] : continue if enable : interfaces [ interface ] [ 'Proxies' ] [ 'ProxyAutoConfigEnable' ] = 1 interfaces [ interface ] [ 'Proxies' ] [ 'ProxyAutoConfigURLString' ] = pac else : interfaces [ interface ] [ 'Proxies' ] [ 'ProxyAutoConfigEnable' ] = 0 self . SetPathValue ( u'/NetworkServices' , interfaces )