summaryrefslogtreecommitdiff
path: root/py/demo/IceGrid/simple/Client.py
diff options
context:
space:
mode:
Diffstat (limited to 'py/demo/IceGrid/simple/Client.py')
-rw-r--r--py/demo/IceGrid/simple/Client.py54
1 files changed, 27 insertions, 27 deletions
diff --git a/py/demo/IceGrid/simple/Client.py b/py/demo/IceGrid/simple/Client.py
index c0dad5d49b4..7651802c658 100644
--- a/py/demo/IceGrid/simple/Client.py
+++ b/py/demo/IceGrid/simple/Client.py
@@ -26,39 +26,39 @@ x: exit
class Client(Ice.Application):
def run(self, args):
hello = None
- try:
- hello = Demo.HelloPrx.checkedCast(self.communicator().stringToProxy("hello"))
- except Ice.NotRegisteredException:
- query = IceGrid.QueryPrx.checkedCast(self.communicator().stringToProxy("DemoIceGrid/Query"))
- hello = Demo.HelloPrx.checkedCast(query.findObjectByType("::Demo::Hello"))
+ try:
+ hello = Demo.HelloPrx.checkedCast(self.communicator().stringToProxy("hello"))
+ except Ice.NotRegisteredException:
+ query = IceGrid.QueryPrx.checkedCast(self.communicator().stringToProxy("DemoIceGrid/Query"))
+ hello = Demo.HelloPrx.checkedCast(query.findObjectByType("::Demo::Hello"))
- if not hello:
- print self.appName() + ": couldn't find a `::Demo::Hello' object."
- return False
+ if not hello:
+ print self.appName() + ": couldn't find a `::Demo::Hello' object."
+ return False
- menu()
+ menu()
- c = None
- while c != 'x':
- try:
- c = raw_input("==> ")
- if c == 't':
- hello.sayHello()
- elif c == 's':
- hello.shutdown()
- elif c == 'x':
- pass # Nothing to do
- elif c == '?':
- menu()
- else:
- print "unknown command `" + c + "'"
- menu()
- except EOFError:
- break
+ c = None
+ while c != 'x':
+ try:
+ c = raw_input("==> ")
+ if c == 't':
+ hello.sayHello()
+ elif c == 's':
+ hello.shutdown()
+ elif c == 'x':
+ pass # Nothing to do
+ elif c == '?':
+ menu()
+ else:
+ print "unknown command `" + c + "'"
+ menu()
+ except EOFError:
+ break
except KeyboardInterrupt:
break
- return True
+ return True
app = Client()
sys.exit(app.main(sys.argv, "config.client"))