1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-05 21:34:16 +01:00

Removing placeholders, and fixing issues pointed out by Dan

This commit is contained in:
Dario Freddi
2009-03-03 11:40:34 +01:00
parent ecfe372e4e
commit 1e65babbd9

View File

@@ -485,27 +485,26 @@ class WirelessInterface(Interface, wnettools.BaseWirelessInterface):
""" Get the current bitrate for the interface. """ """ Get the current bitrate for the interface. """
if not self.iface: return "" if not self.iface: return ""
data = (self.iface + '\0' * 32)[:32] data = (self.iface + '\0' * 32)[:32]
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
fmt = "ihbb" fmt = "ihbb"
size = struct.calcsize(fmt) size = struct.calcsize(fmt)
try: try:
data = fcntl.ioctl(s, 0x8B21, ifreq)[16:]  # 0x8B21 is SIOCGIWRATE in /usr/include/linux/wireless.h result = fcntl.ioctl(self.sock.fileno(), SIOCGIWRATE, data)[16:]
except IOError, e: except IOError, e:
if self.verbose: if self.verbose:
print "SIOCGIWAP failed: " + str(e) print "SIOCGIWRATE failed: " + str(e)
return "" return ""
f, e, x, x = struct.unpack(fmt, data[:size]) f, e, x, x = struct.unpack(fmt, result[:size])
return (f / 1000000) + ' Mb/s' return (f / 1000000) + ' Mb/s'
def GetOperationalMode(self, iwconfig=None): #def GetOperationalMode(self, iwconfig=None):
""" Get the MAC address for the interface. """ """ Get the MAC address for the interface. """
# TODO: implement me # TODO: implement me
return '' # return ''
def GetAvailableAuthMethods(self, iwlistauth=None): #def GetAvailableAuthMethods(self, iwlistauth=None):
""" Get the MAC address for the interface. """ """ Get the MAC address for the interface. """
# TODO: Implement me # TODO: Implement me
return '' # return ''
def GetSignalStrength(self, iwconfig=None): def GetSignalStrength(self, iwconfig=None):
""" Get the signal strength of the current network. """ Get the signal strength of the current network.