mirror of
https://github.com/gryf/wicd.git
synced 2026-01-30 20:45:46 +01:00
Merged with r358 of mainline 1.6.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: wicd-daemon
|
# Provides: wicd-daemon
|
||||||
# Required-Start: dbus
|
# Required-Start: dbus
|
||||||
# Required-Stop:
|
# Required-Stop: $null
|
||||||
# Default-Start: 3 4 5
|
# Default-Start: 3 4 5
|
||||||
# Default-Stop:
|
# Default-Stop:
|
||||||
# Description: wicd, a wired and wireless connection manager.
|
# Description: wicd, a wired and wireless connection manager.
|
||||||
|
|||||||
@@ -116,7 +116,9 @@ def expand_script_macros(script, msg, bssid, essid):
|
|||||||
script -- the script to execute.
|
script -- the script to execute.
|
||||||
msg -- the name of the script, %{script} will be expanded to this.
|
msg -- the name of the script, %{script} will be expanded to this.
|
||||||
bssid -- the bssid of the network we connect to, defaults to 'wired'.
|
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):
|
def repl(match):
|
||||||
macro = match.group(1).lower()
|
macro = match.group(1).lower()
|
||||||
if macro_dict.has_key(macro):
|
if macro_dict.has_key(macro):
|
||||||
@@ -564,23 +566,13 @@ class Wireless(Controller):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
def comp(x, y):
|
def comp(x, y):
|
||||||
if x.has_key('quality'):
|
if 'quality' in x:
|
||||||
if x['quality'] > y['quality']:
|
key = 'quality'
|
||||||
return 1
|
|
||||||
elif x['quality'] < y['quality']:
|
|
||||||
return -1
|
|
||||||
else:
|
|
||||||
return 0
|
|
||||||
else:
|
else:
|
||||||
if x['strength'] < y['strength']:
|
key = 'strength'
|
||||||
return 1
|
return cmp(x[key], y[key])
|
||||||
elif x['strength'] > y['strength']:
|
|
||||||
return -1
|
|
||||||
else:
|
|
||||||
return 0
|
|
||||||
|
|
||||||
if not self.wiface: return []
|
if not self.wiface: return []
|
||||||
|
|
||||||
wiface = self.wiface
|
wiface = self.wiface
|
||||||
|
|
||||||
# Prepare the interface for scanning
|
# Prepare the interface for scanning
|
||||||
@@ -771,6 +763,7 @@ class Wireless(Controller):
|
|||||||
""" Sets the wpa_supplicant driver associated with the interface. """
|
""" Sets the wpa_supplicant driver associated with the interface. """
|
||||||
self.wiface.SetWpaDriver(driver)
|
self.wiface.SetWpaDriver(driver)
|
||||||
|
|
||||||
|
|
||||||
class WirelessConnectThread(ConnectThread):
|
class WirelessConnectThread(ConnectThread):
|
||||||
""" A thread class to perform the connection to a wireless network.
|
""" A thread class to perform the connection to a wireless network.
|
||||||
|
|
||||||
@@ -1063,4 +1056,3 @@ class WiredConnectThread(ConnectThread):
|
|||||||
|
|
||||||
self.connect_result = "Success"
|
self.connect_result = "Success"
|
||||||
self.is_connecting = False
|
self.is_connecting = False
|
||||||
|
|
||||||
|
|||||||
@@ -220,6 +220,8 @@ class BaseInterface(object):
|
|||||||
if self.dhclient_cmd and cl in [misc.DHCLIENT, misc.AUTO]:
|
if self.dhclient_cmd and cl in [misc.DHCLIENT, misc.AUTO]:
|
||||||
client = "dhclient"
|
client = "dhclient"
|
||||||
cmd = self.dhclient_cmd
|
cmd = self.dhclient_cmd
|
||||||
|
if self.dhclient_needs_verbose:
|
||||||
|
cmd += ' -v'
|
||||||
elif self.dhcpcd_cmd and cl in [misc.DHCPCD, misc.AUTO]:
|
elif self.dhcpcd_cmd and cl in [misc.DHCPCD, misc.AUTO]:
|
||||||
client = "dhcpcd"
|
client = "dhcpcd"
|
||||||
cmd = self.dhcpcd_cmd
|
cmd = self.dhcpcd_cmd
|
||||||
@@ -294,6 +296,11 @@ class BaseInterface(object):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
self.dhclient_cmd = self._find_program_path("dhclient")
|
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.dhcpcd_cmd = self._find_program_path("dhcpcd")
|
||||||
self.pump_cmd = self._find_program_path("pump")
|
self.pump_cmd = self._find_program_path("pump")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user