Explorar el Código

Removed dependency on networksetup to get list of network interfaces

tags/v1.0.0
Robert Klep hace 11 años
padre
commit
9d3590f27f
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. +3
    -2
      ToggleProxy.py

+ 3
- 2
ToggleProxy.py Ver fichero

@@ -65,8 +65,9 @@ class ToggleProxy(NSObject):
def loadNetworkServices(self):
""" load list of network services """
self.services = {}
output = commands.getoutput("/usr/sbin/networksetup listnetworkserviceorder")
for servicename, service, device in re.findall(r'\(\d\)\s*(.*?)(?:\n|\r\n?)\(Hardware Port:\s*(.*?), Device:\s*(.*?)\)', output, re.MULTILINE):
for interface in SCNetworkInterfaceCopyAll():
device = SCNetworkInterfaceGetBSDName(interface)
servicename = SCNetworkInterfaceGetLocalizedDisplayName(interface)
self.services[device] = servicename

def watchForProxyChanges(self):


Cargando…
Cancelar
Guardar