From 334f1427233510aa5249e4e2dea4b1e5c76c514f Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 10 Apr 2008 01:18:46 +0200 Subject: * host/proto: - added program io utility. - added Proto.wait. --- host/proto/test/asserv.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'host/proto/test') diff --git a/host/proto/test/asserv.py b/host/proto/test/asserv.py index e578d9dd..265f0815 100644 --- a/host/proto/test/asserv.py +++ b/host/proto/test/asserv.py @@ -2,13 +2,11 @@ import sys sys.path.append (sys.path[0] + '/..') import proto -from fio import IO +from popen_io import PopenIO import time, select, os # Pass program name as argument. -fout, fin = os.popen2 (sys.argv[1:], 't', 1) -time.sleep (0.5) -io = IO (fin, fout) +io = PopenIO (sys.argv[1:]) def log (x): print x @@ -30,7 +28,4 @@ p.register ('C', 'HHH', counter_stat) p.send ('C', 'B', 255) -while not p.sync () or done != 3: - fds = select.select ((p,), (), (), 0.1)[0] - for i in fds: - i.read () +p.wait (lambda: done == 3) -- cgit v1.2.3