mirror of
https://github.com/gryf/wicd.git
synced 2025-12-23 14:42:29 +01:00
Make GetWirelessInterfaces() return a list instead of the first interface. Also make the networking.py layer pull the first entry from the list.
Some documentation cleanup.
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
This module implements functions to control and obtain information from
|
||||
network interfaces.
|
||||
|
||||
def SetDNS() -- Set the DNS servers of the system.
|
||||
def GetWirelessInterfaces() -- Get the wireless interfaces available.
|
||||
class Interface() -- Control a network interface.
|
||||
class WiredInterface() -- Control a wired network interface.
|
||||
class WirelessInterface() -- Control a wireless network interface.
|
||||
|
||||
@@ -6,8 +6,6 @@ This module implements functions to control and obtain information from
|
||||
network interfaces. It utilizes ioctl calls and python modules to
|
||||
obtain this information whenever possible.
|
||||
|
||||
def SetDNS() -- Set the DNS servers of the system.
|
||||
def GetWirelessInterfaces() -- Get the wireless interfaces available.
|
||||
class Interface() -- Control a network interface.
|
||||
class WiredInterface() -- Control a wired network interface.
|
||||
class WirelessInterface() -- Control a wireless network interface.
|
||||
|
||||
@@ -668,7 +668,11 @@ class Wireless(Controller):
|
||||
The first available wireless interface.
|
||||
|
||||
"""
|
||||
return BACKEND.GetWirelessInterfaces()
|
||||
ifaces = BACKEND.GetWirelessInterfaces()
|
||||
if ifaces:
|
||||
return ifaces[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
def GetKillSwitchStatus(self):
|
||||
""" Get the current status of the Killswitch.
|
||||
|
||||
@@ -127,7 +127,7 @@ def GetWirelessInterfaces():
|
||||
ifnames = [iface for iface in os.listdir(dev_dir) if os.path.isdir(dev_dir + iface)
|
||||
and 'wireless' in os.listdir(dev_dir + iface)]
|
||||
|
||||
return bool(ifnames) and ifnames[0] or None
|
||||
return ifnames
|
||||
|
||||
def GetWiredInterfaces():
|
||||
""" Returns a list of wired interfaces on the system. """
|
||||
|
||||
Reference in New Issue
Block a user