1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-09 07:14:13 +01:00

Merged with r358 of mainline 1.6.

This commit is contained in:
Andrew Psaltis
2009-04-21 13:15:30 -04:00
4 changed files with 5517 additions and 52 deletions

5536
CHANGES

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
### BEGIN INIT INFO
# Provides: wicd-daemon
# Required-Start: dbus
# Required-Stop:
# Required-Stop: $null
# Default-Start: 3 4 5
# Default-Stop:
# Description: wicd, a wired and wireless connection manager.

View File

@@ -116,7 +116,9 @@ def expand_script_macros(script, msg, bssid, essid):
script -- the script to execute.
msg -- the name of the script, %{script} will be expanded to this.
bssid -- the bssid of the network we connect to, defaults to 'wired'.
essid -- the essid of the network we connect to, defaults to 'wired'."""
essid -- the essid of the network we connect to, defaults to 'wired'.
"""
def repl(match):
macro = match.group(1).lower()
if macro_dict.has_key(macro):
@@ -564,23 +566,13 @@ class Wireless(Controller):
"""
def comp(x, y):
if x.has_key('quality'):
if x['quality'] > y['quality']:
return 1
elif x['quality'] < y['quality']:
return -1
else:
return 0
if 'quality' in x:
key = 'quality'
else:
if x['strength'] < y['strength']:
return 1
elif x['strength'] > y['strength']:
return -1
else:
return 0
key = 'strength'
return cmp(x[key], y[key])
if not self.wiface: return []
wiface = self.wiface
# Prepare the interface for scanning
@@ -771,6 +763,7 @@ class Wireless(Controller):
""" Sets the wpa_supplicant driver associated with the interface. """
self.wiface.SetWpaDriver(driver)
class WirelessConnectThread(ConnectThread):
""" A thread class to perform the connection to a wireless network.
@@ -1063,4 +1056,3 @@ class WiredConnectThread(ConnectThread):
self.connect_result = "Success"
self.is_connecting = False

View File

@@ -220,6 +220,8 @@ class BaseInterface(object):
if self.dhclient_cmd and cl in [misc.DHCLIENT, misc.AUTO]:
client = "dhclient"
cmd = self.dhclient_cmd
if self.dhclient_needs_verbose:
cmd += ' -v'
elif self.dhcpcd_cmd and cl in [misc.DHCPCD, misc.AUTO]:
client = "dhcpcd"
cmd = self.dhcpcd_cmd
@@ -294,6 +296,11 @@ class BaseInterface(object):
"""
self.dhclient_cmd = self._find_program_path("dhclient")
output = misc.Run(self.dhclient_cmd + " --version", include_stderr=True)
if '4.' in output:
self.dhclient_needs_verbose = True
else:
self.dhclient_needs_verbose = False
self.dhcpcd_cmd = self._find_program_path("dhcpcd")
self.pump_cmd = self._find_program_path("pump")