From: Cameron Patrick Date: Sun, 1 Aug 2004 06:39:06 +0000 (+0000) Subject: add more debugging to write_expecting_echo X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=f86fab7002399856acd988aad87868c78677b82e;p=zanchey%2Fdispense2.git add more debugging to write_expecting_echo --- diff --git a/sql-edition/servers/LATClient.py b/sql-edition/servers/LATClient.py index ffa8963..dedc1ff 100644 --- a/sql-edition/servers/LATClient.py +++ b/sql-edition/servers/LATClient.py @@ -28,9 +28,14 @@ def write_expecting_echo(rfh, wfh, message): while len(message) > 0: wfh.write(message[0]) wfh.flush() - echo = rfh.read(1) - if echo != message[0]: - print "Gah, expected echo when writing", message[0] + if message[0] == '\n': + echo = rfh.read(2) + expected_echo = '\r\n' + else: + echo = rfh.read(1) + expected_echo = message[0] + if echo != expected_echo: + print "Gah, expected echo when writing", repr(message[0]), "but got", repr(echo) message = message[1:] print " --> Sent and echoed."