1.1 --- a/client.py Sun Jan 10 00:30:41 2016 +0100
1.2 +++ b/client.py Sun Jan 10 22:58:17 2016 +0100
1.3 @@ -47,13 +47,14 @@
1.4 resp = s.readline().rstrip("\r\n")
1.5 return resp
1.6
1.7 -def console():
1.8 +def console(prompt=True):
1.9 try:
1.10 while 1:
1.11 - cmd = raw_input("> ")
1.12 - if cmd:
1.13 - s.write(cmd + "\n")
1.14 - s.flush()
1.15 + if prompt:
1.16 + cmd = raw_input("> ")
1.17 + if cmd:
1.18 + s.write(cmd + "\n")
1.19 + s.flush()
1.20 print s.readline().rstrip("\r\n")
1.21 except EOFError:
1.22 print "Session closed."
1.23 @@ -62,7 +63,7 @@
1.24 openPort()
1.25
1.26 try:
1.27 - console()
1.28 + console(not "--read-only" in sys.argv)
1.29 finally:
1.30 closePort()
1.31