summaryrefslogtreecommitdiffstats
path: root/tools/site_compare/utils
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 12:46:38 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 12:46:38 +0000
commitf0a51fb571f46531025fa09240bbc3e1af925e84 (patch)
tree558b4f0e737fda4b9ab60f252c9c23b8a4ca523e /tools/site_compare/utils
parent6390be368205705f49ead3cec40396519f13b889 (diff)
downloadchromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.zip
chromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.tar.gz
chromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.tar.bz2
Fixes CRLF and trailing white spaces.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/site_compare/utils')
-rw-r--r--tools/site_compare/utils/browser_iterate.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/site_compare/utils/browser_iterate.py b/tools/site_compare/utils/browser_iterate.py
index 50ed411..6ea4e5f 100644
--- a/tools/site_compare/utils/browser_iterate.py
+++ b/tools/site_compare/utils/browser_iterate.py
@@ -32,7 +32,7 @@ PORT = 42492
def SetupIterationCommandLine(cmd):
"""Adds the necessary flags for iteration to a command.
-
+
Args:
cmd: an object created by cmdline.AddCommand
"""
@@ -71,15 +71,15 @@ def SetupIterationCommandLine(cmd):
def Iterate(command, iteration_func):
"""Iterates over a list of URLs, calling a function on each.
-
+
Args:
command: the command line containing the iteration flags
iteration_func: called for each URL with (proc, wnd, url, result)
"""
-
+
# Retrieve the browser scraper to use to invoke the browser
scraper = scrapers.GetScraper((command["--browser"], command["--browserver"]))
-
+
def AttachToBrowser(path, timeout):
"""Invoke the browser process and connect to the socket."""
(proc, frame, wnd) = scraper.GetBrowser(path)
@@ -106,7 +106,7 @@ def Iterate(command, iteration_func):
if command["--size"]:
# Resize and reposition the frame
windowing.MoveAndSizeWindow(frame, (0, 0), command["--size"], wnd)
-
+
s.settimeout(timeout)
Iterate.proc = proc
@@ -133,7 +133,7 @@ def Iterate(command, iteration_func):
browser = command["--browserpath"]
else:
browser = None
-
+
# Read the URLs from the file
if command["--url"]:
url_list = [command["--url"]]
@@ -174,13 +174,13 @@ def Iterate(command, iteration_func):
try:
recv = Iterate.s.recv(MAX_URL)
response = response + recv
-
+
# Workaround for an oddity: when Firefox closes
# gracefully, somehow Python doesn't detect it.
# (Telnet does)
- if not recv:
+ if not recv:
raise socket.error
-
+
except socket.timeout:
response = url + ",hang\n"
DetachFromBrowser()
@@ -192,10 +192,10 @@ def Iterate(command, iteration_func):
# If we received a timeout response, restart the browser
if response[-9:] == ",timeout\n":
DetachFromBrowser()
-
+
# Invoke the iteration function
iteration_func(url, Iterate.proc, Iterate.wnd, response)
- # We're done
+ # We're done
DetachFromBrowser()