1
0
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:
Dan O'Reilly
2009-02-02 23:47:54 -05:00
parent 6347842000
commit e23af9b413
4 changed files with 6 additions and 6 deletions

View File

@@ -6,8 +6,6 @@
This module implements functions to control and obtain information from This module implements functions to control and obtain information from
network interfaces. 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 Interface() -- Control a network interface.
class WiredInterface() -- Control a wired network interface. class WiredInterface() -- Control a wired network interface.
class WirelessInterface() -- Control a wireless network interface. class WirelessInterface() -- Control a wireless network interface.

View File

@@ -6,8 +6,6 @@ This module implements functions to control and obtain information from
network interfaces. It utilizes ioctl calls and python modules to network interfaces. It utilizes ioctl calls and python modules to
obtain this information whenever possible. 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 Interface() -- Control a network interface.
class WiredInterface() -- Control a wired network interface. class WiredInterface() -- Control a wired network interface.
class WirelessInterface() -- Control a wireless network interface. class WirelessInterface() -- Control a wireless network interface.

View File

@@ -668,7 +668,11 @@ class Wireless(Controller):
The first available wireless interface. The first available wireless interface.
""" """
return BACKEND.GetWirelessInterfaces() ifaces = BACKEND.GetWirelessInterfaces()
if ifaces:
return ifaces[0]
else:
return None
def GetKillSwitchStatus(self): def GetKillSwitchStatus(self):
""" Get the current status of the Killswitch. """ Get the current status of the Killswitch.

View File

@@ -127,7 +127,7 @@ def GetWirelessInterfaces():
ifnames = [iface for iface in os.listdir(dev_dir) if os.path.isdir(dev_dir + iface) ifnames = [iface for iface in os.listdir(dev_dir) if os.path.isdir(dev_dir + iface)
and 'wireless' in os.listdir(dev_dir + iface)] and 'wireless' in os.listdir(dev_dir + iface)]
return bool(ifnames) and ifnames[0] or None return ifnames
def GetWiredInterfaces(): def GetWiredInterfaces():
""" Returns a list of wired interfaces on the system. """ """ Returns a list of wired interfaces on the system. """