summaryrefslogtreecommitdiff
path: root/cpp/demo/Glacier2/chat/expect.py
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2012-04-24 14:16:15 -0700
committerMark Spruiell <mes@zeroc.com>2012-04-24 14:16:15 -0700
commit943a48fc5c0a59b892eb746073c71b8dd88815e7 (patch)
tree421cfedbc60603d02e0b314d9204e9f85dd781c5 /cpp/demo/Glacier2/chat/expect.py
parentminor fix to IcePHP getLogger (diff)
downloadice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.bz2
ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.xz
ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.zip
python 3 support
Diffstat (limited to 'cpp/demo/Glacier2/chat/expect.py')
-rwxr-xr-xcpp/demo/Glacier2/chat/expect.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/cpp/demo/Glacier2/chat/expect.py b/cpp/demo/Glacier2/chat/expect.py
index 890960bb98b..a59a5c888c0 100755
--- a/cpp/demo/Glacier2/chat/expect.py
+++ b/cpp/demo/Glacier2/chat/expect.py
@@ -16,10 +16,10 @@ if len(head) > 0:
path = [os.path.join(head, p) for p in path]
path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ]
if len(path) == 0:
- raise "can't find toplevel directory!"
+ raise RuntimeError("can't find toplevel directory!")
sys.path.append(path[0])
-from demoscript import *
+from demoscript import Util
server = Util.spawn('./server --Ice.PrintAdapterReady')
server.expect('.* ready')
@@ -28,16 +28,16 @@ glacier2 = Util.spawn(Util.getGlacier2Router() + ' --Ice.Config=config.glacier2
glacier2.expect('Glacier2.Client ready')
glacier2.expect('Glacier2.Server ready')
-print "starting client 1...",
+sys.stdout.write("starting client 1... ")
sys.stdout.flush()
client1 = Util.spawn('./client')
client1.expect('user id:')
client1.sendline("foo")
client1.expect('password:')
client1.sendline("foo")
-print "ok"
+print("ok")
-print "starting client 2...",
+sys.stdout.write("starting client 2... ")
sys.stdout.flush()
client2 = Util.spawn('./client')
client2.expect('user id:')
@@ -46,9 +46,9 @@ client2.expect('password:')
client2.sendline("bar")
client1.expect("bar has entered the chat room")
-print "ok"
+print("ok")
-print "testing chat...",
+sys.stdout.write("testing chat... ")
sys.stdout.flush()
client1.sendline("hi")
client1.expect("foo says: hi")
@@ -64,7 +64,7 @@ client2.expect("foo has left the chat room")
client2.sendline("/quit")
client2.waitTestSuccess()
-print "ok"
+print("ok")
server.kill(signal.SIGINT)
server.waitTestSuccess()