diff options
author | Matthew Newhook <matthew@zeroc.com> | 2009-03-12 02:01:55 +0800 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2009-03-12 02:01:55 +0800 |
commit | c35697fb275246428b0896af0d995519ec20c476 (patch) | |
tree | 80fc1b158fb8a79dadf2618ff4bb3b9ba2637847 /scripts/Expect.py | |
parent | backout bogus change from 3822 (diff) | |
download | ice-c35697fb275246428b0896af0d995519ec20c476.tar.bz2 ice-c35697fb275246428b0896af0d995519ec20c476.tar.xz ice-c35697fb275246428b0896af0d995519ec20c476.zip |
http://bugzilla/bugzilla/show_bug.cgi?id=3808 - odd output in IceGrid/activation test.
Squashed commit of the following:
commit 201ba9220339ff3a1a828b16782bf78d39949ed7
Author: Matthew Newhook <matthew@centosvm4.matthew.zeroc.com>
Date: Thu Mar 12 01:51:20 2009 +0800
Delay the start of the reading thread until "ok" has been printed.
commit a5eadfe584720f93502fffcd08ef40acab5416c6
Author: Matthew Newhook <matthew@centosvm4.matthew.zeroc.com>
Date: Thu Mar 12 00:52:17 2009 +0800
added missing flush.
Diffstat (limited to 'scripts/Expect.py')
-rwxr-xr-x | scripts/Expect.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/Expect.py b/scripts/Expect.py index 06aad79af2e..cc02bcda0f1 100755 --- a/scripts/Expect.py +++ b/scripts/Expect.py @@ -115,6 +115,7 @@ class reader(threading.Thread): self._tbuf.truncate(0) else: sys.stdout.write(c) + sys.stdout.flush() def enabletrace(self, supress = None): self.cv.acquire() @@ -287,7 +288,7 @@ def splitCommand(command_line): return arg_list class Expect (object): - def __init__(self, command, timeout=30, logfile=None, mapping = None, desc = None, cwd = None, env = None): + def __init__(self, command, startReader = True, timeout=30, logfile=None, mapping = None, desc = None, cwd = None, env = None): self.buf = "" # The part before the match self.before = "" # The part before the match self.after = "" # The part after the match @@ -324,6 +325,10 @@ class Expect (object): # terminates and joins with the reader thread. self.r.setDaemon(True) + if startReader: + self.startReader() + + def startReader(self): self.r.start() def __del__(self): |