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

Unified Diff: blimp/tools/client_engine_integration.py

Issue 2236143002: Add live output for blimp integration script {run} func (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use sys.stdout.write instead of print Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/tools/client_engine_integration.py
diff --git a/blimp/tools/client_engine_integration.py b/blimp/tools/client_engine_integration.py
index f1807f38cfde71d61f3b9718402d90c1fc9b1ea4..d7148f4ecc025a0dcd658637c11738284648c6fb 100755
--- a/blimp/tools/client_engine_integration.py
+++ b/blimp/tools/client_engine_integration.py
@@ -19,7 +19,6 @@ import re
import signal
import subprocess
import sys
-import time
SRC_PATH = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..'))
@@ -102,6 +101,7 @@ def RunEngine(output_linux_directory, token_file_path):
stderr=subprocess.STDOUT)
for line in iter(p.stdout.readline, ''):
+ sys.stdout.write(line)
l = line.rstrip()
match = re.match(PORT_PATTERN, l)
if match:
@@ -200,11 +200,13 @@ def _Run(args, json_file_path, device):
try:
engine_process = _Start(args, json_file_path, device)
while True:
- time.sleep(1)
- return_code = engine_process.poll()
- if return_code is not None:
+ nextline = engine_process.stdout.readline()
+ if nextline == '' and engine_process.poll() is not None:
# The engine died.
sys.exit(1)
+ sys.stdout.write(nextline)
+ sys.stdout.flush()
+
except KeyboardInterrupt:
sys.exit(0)
finally:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698