Selaa lähdekoodia

Removed dependency on networksetup to get list of network interfaces

tags/v1.0.0
Robert Klep 11 vuotta sitten
vanhempi
commit
9d3590f27f
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. +3
    -2
      ToggleProxy.py

+ 3
- 2
ToggleProxy.py Näytä tiedosto

@@ -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):


Ladataan…
Peruuta
Tallenna