Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: server/site_wlan_connect.py

Issue 3166012: Whitespace cleanups (Closed) Base URL: ssh://gitrw.chromium.org/autotest.git
Patch Set: Long day. Must merge first. Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « server/site_linux_router.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import dbus, dbus.mainloop.glib, gobject, logging, re, sys, time, subprocess 1 import dbus, dbus.mainloop.glib, gobject, logging, re, sys, time, subprocess
2 2
3 ssid = sys.argv[1] 3 ssid = sys.argv[1]
4 security = sys.argv[2] 4 security = sys.argv[2]
5 psk = sys.argv[3] 5 psk = sys.argv[3]
6 assoc_timeout = float(sys.argv[4]) 6 assoc_timeout = float(sys.argv[4])
7 config_timeout = float(sys.argv[5]) 7 config_timeout = float(sys.argv[5])
8 reset_timeout = float(sys.argv[6]) if len(sys.argv) > 6 else assoc_timeout 8 reset_timeout = float(sys.argv[6]) if len(sys.argv) > 6 else assoc_timeout
9 9
10 bus_loop = dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) 10 bus_loop = dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 while wait_time < reset_timeout: 67 while wait_time < reset_timeout:
68 if service.GetProperties().get("State", None) == "idle": 68 if service.GetProperties().get("State", None) == "idle":
69 break 69 break
70 time.sleep(2) 70 time.sleep(2)
71 wait_time += 2 71 wait_time += 2
72 72
73 print>>sys.stderr, "cleared ourselves out of '%s' after %3.1f secs" % \ 73 print>>sys.stderr, "cleared ourselves out of '%s' after %3.1f secs" % \
74 (init_state, wait_time) 74 (init_state, wait_time)
75 time.sleep(4) 75 time.sleep(4)
76 76
77 77
78 def TryConnect(assoc_time): 78 def TryConnect(assoc_time):
79 init_assoc_time = assoc_time 79 init_assoc_time = assoc_time
80 try: 80 try:
81 init_props = service.GetProperties() 81 init_props = service.GetProperties()
82 init_state = init_props.get("State", None) 82 init_state = init_props.get("State", None)
83 if init_state == "configuration" or init_state == "ready": 83 if init_state == "configuration" or init_state == "ready":
84 if assoc_time > 0: 84 if assoc_time > 0:
85 # We connected in the time between the last failure and now 85 # We connected in the time between the last failure and now
86 print>>sys.stderr, "Associated while we weren't looking!" 86 print>>sys.stderr, "Associated while we weren't looking!"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 config_time += .5 211 config_time += .5
212 if config_time >= config_timeout: 212 if config_time >= config_timeout:
213 print "TIMEOUT(config): ssid %s assoc %3.1f config %3.1f secs" \ 213 print "TIMEOUT(config): ssid %s assoc %3.1f config %3.1f secs" \
214 %(ssid, assoc_time, config_time) 214 %(ssid, assoc_time, config_time)
215 DumpLogs(logs) 215 DumpLogs(logs)
216 sys.exit(6) 216 sys.exit(6)
217 217
218 print "OK %3.1f %3.1f %s (assoc and config times in sec, quirks)" \ 218 print "OK %3.1f %3.1f %s (assoc and config times in sec, quirks)" \
219 %(assoc_time, config_time, str(connect_quirks.keys())) 219 %(assoc_time, config_time, str(connect_quirks.keys()))
220 sys.exit(0) 220 sys.exit(0)
221
OLDNEW
« no previous file with comments | « server/site_linux_router.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698