diff --git a/daemon.py b/daemon.py index 09bb4d8..9632dc5 100644 --- a/daemon.py +++ b/daemon.py @@ -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 diff --git a/misc.py b/misc.py index 47505a0..8a002ae 100644 --- a/misc.py +++ b/misc.py @@ -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. diff --git a/wnettools.py b/wnettools.py index 3597726..654f3ed 100644 --- a/wnettools.py +++ b/wnettools.py @@ -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: