mirror of
https://github.com/gryf/wicd.git
synced 2026-03-15 06:03:40 +01:00
experimental:
- Some minor cleanup/formatting fixes - Add a missing DetectWiredInterfaces() method to networking.py
This commit is contained in:
@@ -1402,7 +1402,6 @@ def main(argv):
|
|||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
no_poll = False
|
no_poll = False
|
||||||
scan_interval = "120000"
|
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
if o in ('-h', '--help'):
|
if o in ('-h', '--help'):
|
||||||
usage()
|
usage()
|
||||||
@@ -1437,8 +1436,7 @@ def main(argv):
|
|||||||
|
|
||||||
gobject.threads_init()
|
gobject.threads_init()
|
||||||
if not no_poll:
|
if not no_poll:
|
||||||
(child_pid, x, x, x) = gobject.spawn_async([wpath.bin + "monitor.py",
|
(child_pid, x, x, x) = gobject.spawn_async([wpath.bin + "monitor.py"],
|
||||||
scan_interval],
|
|
||||||
flags=gobject.SPAWN_CHILD_INHERITS_STDIN)
|
flags=gobject.SPAWN_CHILD_INHERITS_STDIN)
|
||||||
signal.signal(signal.SIGTERM, sigterm_caught)
|
signal.signal(signal.SIGTERM, sigterm_caught)
|
||||||
|
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
|||||||
if ID == -1:
|
if ID == -1:
|
||||||
self.combo_encryption.set_active(0)
|
self.combo_encryption.set_active(0)
|
||||||
ID = 0
|
ID = 0
|
||||||
|
|
||||||
opts = methods[ID][2]
|
opts = methods[ID][2]
|
||||||
for x in opts:
|
for x in opts:
|
||||||
box = None
|
box = None
|
||||||
@@ -417,9 +417,9 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
|||||||
box = LabelEntry(opts[x][0].replace('_',' '))
|
box = LabelEntry(opts[x][0].replace('_',' '))
|
||||||
box.set_auto_hidden(True)
|
box.set_auto_hidden(True)
|
||||||
self.vbox_encrypt_info.pack_start(box)
|
self.vbox_encrypt_info.pack_start(box)
|
||||||
#add the data to any array, so that the information
|
# Add the data to any array, so that the information
|
||||||
#can be easily accessed by giving the name of the wanted
|
# can be easily accessed by giving the name of the wanted
|
||||||
#data
|
# data.
|
||||||
self.encryption_info[opts[x][1]] = box.entry
|
self.encryption_info[opts[x][1]] = box.entry
|
||||||
|
|
||||||
box.entry.set_text(noneToBlankString(
|
box.entry.set_text(noneToBlankString(
|
||||||
|
|||||||
@@ -800,6 +800,13 @@ class Wired(Controller):
|
|||||||
self.connecting_thread.setDaemon(True)
|
self.connecting_thread.setDaemon(True)
|
||||||
self.connecting_thread.start()
|
self.connecting_thread.start()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def DetectWiredInterface(self):
|
||||||
|
""" Attempts to automatically detect a wired interface. """
|
||||||
|
try:
|
||||||
|
return wnettools.GetWiredInterfaces()[0]
|
||||||
|
except IndexError:
|
||||||
|
return None
|
||||||
|
|
||||||
def GetIP(self, fast=False):
|
def GetIP(self, fast=False):
|
||||||
""" Get the IP of the interface.
|
""" Get the IP of the interface.
|
||||||
|
|||||||
@@ -80,10 +80,10 @@ SIOCGIWAP = 0x8B15
|
|||||||
def _sanitize_string(string):
|
def _sanitize_string(string):
|
||||||
blacklist = [';', '`', '$', '!', '*', '|', '>', '<']
|
blacklist = [';', '`', '$', '!', '*', '|', '>', '<']
|
||||||
new_string = []
|
new_string = []
|
||||||
|
|
||||||
if not string:
|
if not string:
|
||||||
return string
|
return string
|
||||||
|
|
||||||
for c in string:
|
for c in string:
|
||||||
if c in blacklist:
|
if c in blacklist:
|
||||||
new_string.append("\\" + c)
|
new_string.append("\\" + c)
|
||||||
@@ -273,8 +273,6 @@ class Interface(object):
|
|||||||
client = "pump"
|
client = "pump"
|
||||||
return client
|
return client
|
||||||
|
|
||||||
print 'checking dhcp...'
|
|
||||||
|
|
||||||
if self.DHCP_CLIENT:
|
if self.DHCP_CLIENT:
|
||||||
dhcp_client = get_client_name(self.DHCP_CLIENT)
|
dhcp_client = get_client_name(self.DHCP_CLIENT)
|
||||||
dhcp_path = self._find_client_path(dhcp_client)
|
dhcp_path = self._find_client_path(dhcp_client)
|
||||||
|
|||||||
Reference in New Issue
Block a user