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

experimental:

- Some minor cleanup/formatting fixes
- Add a missing DetectWiredInterfaces() method to networking.py
This commit is contained in:
imdano
2008-08-24 08:15:24 +00:00
parent 0844386017
commit 37838ba057
4 changed files with 14 additions and 11 deletions

View File

@@ -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)

View File

@@ -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(

View File

@@ -801,6 +801,13 @@ class Wired(Controller):
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.

View File

@@ -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)