1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-20 04:48:00 +01:00

Lengthened the sleep time between putting a wired interface up and checking to see if the link is active.

A few small optimizations/code cleanup.
This commit is contained in:
imdano
2008-03-31 15:23:59 +00:00
parent ed2d53839e
commit c17b437134
3 changed files with 5 additions and 6 deletions

View File

@@ -173,6 +173,7 @@ class ConnectionWizard(dbus.service.Object):
self.AutoConnect(True)
else:
self.Scan()
self.SetForcedDisconnect(True)
print "--no-scan detected, not autoconnecting..."
########## DAEMON FUNCTIONS

View File

@@ -159,19 +159,17 @@ def ParseEncryption(network):
template = enctemplate.readlines()
# Set these to nothing so that we can hold them outside the loop
z = "ap_scan=1\n"
y = 0
# Loop through the lines in the template, selecting ones to use
for x in template:
for y, x in enumerate(template):
x = x.strip("\n")
if y > 4:
# replace values
x = x.replace("$_SCAN","0")
for t in network:
# Don't bother if z's value is None cause it will cause errors
if Noneify(network[t]) != None:
if Noneify(network[t]) is not None:
x = x.replace("$_" + str(t).upper(), str(network[t]))
z = z + "\n" + x
y += 1
# Write the data to the files then chmod them so they can't be read
# by normal users.

View File

@@ -610,7 +610,7 @@ class WiredInterface(Interface):
def _fast_eth_get_plugged_in(self):
if not self.IsUp():
self.Up()
time.sleep(1)
time.sleep(2.5)
buff = array.array('i', [0x0000000a, 0x00000000])
addr, length = buff.buffer_info()
arg = struct.pack('Pi', addr, length)
@@ -652,7 +652,7 @@ class WiredInterface(Interface):
""" Get link status usingthe SIOCGMIIPHY ioctl. """
if not self.IsUp():
self.Up()
time.sleep(1)
time.sleep(2.5)
buff = struct.pack('16shhhh', (self.iface + '\0' * 16)[:16], 0, 1,
0x0004, 0)
try: