From 388dd88e6a66ce5eaad6d1392c742d43f328af30 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Wed, 17 Dec 2008 23:40:36 +0100 Subject: * host/proto: - added documentation. - fixed small discordance between documentation and behaviour. --- host/proto/proto.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'host/proto/proto.py') diff --git a/host/proto/proto.py b/host/proto/proto.py index 36616d9c..9eb401e1 100644 --- a/host/proto/proto.py +++ b/host/proto/proto.py @@ -33,7 +33,14 @@ class Proto: def __init__ (self, file, date, timeout, log = None): """Initialise and set file (serial port, pty, socket...), date - function and timeout value.""" + function and timeout value. + + - file: open file connected to the slave device. + - date: when called, should return the current time. + - timeout: time after which retransmission is done. + - log: if defined, will be called with a log string. + + """ self.file = file self.date = date self.last_send = None @@ -70,7 +77,7 @@ class Proto: def wait (self, cond = None): """Wait forever or until cond () is True.""" - while not (self.sync () and (cond is None or cond ())): + while not (self.sync () and (cond is not None or cond ())): fds = select.select ((self,), (), (), self.timeout)[0] for i in fds: assert i is self -- cgit v1.2.3