diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2007-03-01 13:12:23 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2007-03-01 13:12:23 +0000 |
commit | 6799cc28d8c40559cfe84476ea7a89b25baaae39 (patch) | |
tree | 695b40a884ca8af0bb0b076e42d174574a89b1fa /py | |
parent | Fixed warning/error messages to be on a single line (diff) | |
download | ice-6799cc28d8c40559cfe84476ea7a89b25baaae39.tar.bz2 ice-6799cc28d8c40559cfe84476ea7a89b25baaae39.tar.xz ice-6799cc28d8c40559cfe84476ea7a89b25baaae39.zip |
Bug 1894 - fix return code
Diffstat (limited to 'py')
-rw-r--r-- | py/demo/Glacier2/callback/Server.py | 2 | ||||
-rw-r--r-- | py/demo/Glacier2/callback/SessionServer.py | 2 | ||||
-rw-r--r-- | py/demo/Ice/async/Client.py | 4 | ||||
-rwxr-xr-x | py/demo/Ice/async/Server.py | 2 | ||||
-rw-r--r-- | py/demo/Ice/hello/Client.py | 4 | ||||
-rw-r--r-- | py/demo/Ice/hello/Server.py | 2 | ||||
-rw-r--r-- | py/demo/Ice/latency/Client.py | 4 | ||||
-rw-r--r-- | py/demo/Ice/latency/Server.py | 2 | ||||
-rw-r--r-- | py/demo/Ice/session/Client.py | 4 | ||||
-rw-r--r-- | py/demo/Ice/session/Server.py | 2 | ||||
-rw-r--r-- | py/demo/Ice/throughput/Client.py | 4 | ||||
-rw-r--r-- | py/demo/Ice/throughput/Server.py | 2 | ||||
-rw-r--r-- | py/demo/Ice/value/Client.py | 4 | ||||
-rw-r--r-- | py/demo/Ice/value/Server.py | 2 | ||||
-rw-r--r-- | py/demo/IceGrid/allocate/Client.py | 8 | ||||
-rw-r--r-- | py/demo/IceGrid/sessionActivation/Client.py | 10 | ||||
-rw-r--r-- | py/demo/IceGrid/simple/Client.py | 4 | ||||
-rw-r--r-- | py/demo/IceStorm/clock/Publisher.py | 10 | ||||
-rw-r--r-- | py/demo/IceStorm/clock/Subscriber.py | 10 |
19 files changed, 41 insertions, 41 deletions
diff --git a/py/demo/Glacier2/callback/Server.py b/py/demo/Glacier2/callback/Server.py index 61f4f81dc2c..9e0a95b1407 100644 --- a/py/demo/Glacier2/callback/Server.py +++ b/py/demo/Glacier2/callback/Server.py @@ -31,7 +31,7 @@ class Server(Ice.Application): adapter.add(CallbackI(), self.communicator().stringToIdentity("callback")) adapter.activate() self.communicator().waitForShutdown() - return True + return 0 app = Server() sys.exit(app.main(sys.argv, "config.server")) diff --git a/py/demo/Glacier2/callback/SessionServer.py b/py/demo/Glacier2/callback/SessionServer.py index af496d28652..456e680b949 100644 --- a/py/demo/Glacier2/callback/SessionServer.py +++ b/py/demo/Glacier2/callback/SessionServer.py @@ -36,7 +36,7 @@ class SessionServer(Ice.Application): adapter.add(SessionManagerI(), self.communicator().stringToIdentity("sessionmanager")) adapter.activate() self.communicator().waitForShutdown() - return True + return 0 app = SessionServer() sys.exit(app.main(sys.argv, "config.sessionserver")) diff --git a/py/demo/Ice/async/Client.py b/py/demo/Ice/async/Client.py index 34d8e278c17..edec43d9777 100644 --- a/py/demo/Ice/async/Client.py +++ b/py/demo/Ice/async/Client.py @@ -36,7 +36,7 @@ class Client(Ice.Application): hello = Demo.HelloPrx.checkedCast(self.communicator().propertyToProxy('Hello.Proxy')) if not hello: print args[0] + ": invalid proxy" - return False + return 1 menu() @@ -64,7 +64,7 @@ class Client(Ice.Application): except Ice.Exception, ex: print ex - return True + return 0 app = Client() sys.exit(app.main(sys.argv, "config.client")) diff --git a/py/demo/Ice/async/Server.py b/py/demo/Ice/async/Server.py index dabcf57c5c3..4e44d1447c6 100755 --- a/py/demo/Ice/async/Server.py +++ b/py/demo/Ice/async/Server.py @@ -98,7 +98,7 @@ class Server(Ice.Application): adapter.activate() self.communicator().waitForShutdown() - return True + return 0 def interruptCallback(self, sig): self._workQueue.destroy() diff --git a/py/demo/Ice/hello/Client.py b/py/demo/Ice/hello/Client.py index f0c79b73cea..48e7711f2b9 100644 --- a/py/demo/Ice/hello/Client.py +++ b/py/demo/Ice/hello/Client.py @@ -36,7 +36,7 @@ class Client(Ice.Application): self.communicator().propertyToProxy('Hello.Proxy').ice_twoway().ice_timeout(-1).ice_secure(False)) if not twoway: print args[0] + ": invalid proxy" - return False + return 1 oneway = Demo.HelloPrx.uncheckedCast(twoway.ice_oneway()) batchOneway = Demo.HelloPrx.uncheckedCast(twoway.ice_batchOneway()) @@ -124,7 +124,7 @@ class Client(Ice.Application): except Ice.Exception, ex: print ex - return True + return 0 app = Client() sys.exit(app.main(sys.argv, "config.client")) diff --git a/py/demo/Ice/hello/Server.py b/py/demo/Ice/hello/Server.py index 411be791aa8..3603eed0bd8 100644 --- a/py/demo/Ice/hello/Server.py +++ b/py/demo/Ice/hello/Server.py @@ -28,7 +28,7 @@ class Server(Ice.Application): adapter.add(HelloI(), self.communicator().stringToIdentity("hello")) adapter.activate() self.communicator().waitForShutdown() - return True + return 0 app = Server() sys.exit(app.main(sys.argv, "config.server")) diff --git a/py/demo/Ice/latency/Client.py b/py/demo/Ice/latency/Client.py index fd6cf0b705e..de05de06f20 100644 --- a/py/demo/Ice/latency/Client.py +++ b/py/demo/Ice/latency/Client.py @@ -18,7 +18,7 @@ class Client(Ice.Application): ping = Demo.PingPrx.checkedCast(self.communicator().propertyToProxy('Latency.Ping')) if not ping: print "invalid proxy" - return False + return 1 # Initial ping to setup the connection. ping.ice_ping(); @@ -39,7 +39,7 @@ class Client(Ice.Application): print "time for %d pings: %.3fms" % (repetitions, tmsec) print "time per ping: %.3fms" % (tmsec / repetitions) - return True + return 0 app = Client() sys.exit(app.main(sys.argv, "config.client")) diff --git a/py/demo/Ice/latency/Server.py b/py/demo/Ice/latency/Server.py index 78bcde29a8e..34e5af410ed 100644 --- a/py/demo/Ice/latency/Server.py +++ b/py/demo/Ice/latency/Server.py @@ -19,7 +19,7 @@ class Server(Ice.Application): adapter.add(Demo.Ping(), self.communicator().stringToIdentity("ping")) adapter.activate() self.communicator().waitForShutdown() - return True + return 0 app = Server() sys.exit(app.main(sys.argv, "config.server")) diff --git a/py/demo/Ice/session/Client.py b/py/demo/Ice/session/Client.py index 63f7ef9997a..bcc83b3eadc 100644 --- a/py/demo/Ice/session/Client.py +++ b/py/demo/Ice/session/Client.py @@ -55,7 +55,7 @@ class Client(Ice.Application): factory = Demo.SessionFactoryPrx.checkedCast(base) if not factory: print args[0] + ": invalid proxy" - return False + return 1 session = factory.create(name) try: @@ -124,7 +124,7 @@ class Client(Ice.Application): refresh.terminate() refresh.join() - return True + return 0 def menu(self): print """ diff --git a/py/demo/Ice/session/Server.py b/py/demo/Ice/session/Server.py index 56cd7e2def8..24248f36a28 100644 --- a/py/demo/Ice/session/Server.py +++ b/py/demo/Ice/session/Server.py @@ -176,7 +176,7 @@ class Server(Ice.Application): finally: reaper.terminate() reaper.join() - return True + return 0 app = Server() sys.exit(app.main(sys.argv, "config.server")) diff --git a/py/demo/Ice/throughput/Client.py b/py/demo/Ice/throughput/Client.py index fc5ff5de065..2951830deaa 100644 --- a/py/demo/Ice/throughput/Client.py +++ b/py/demo/Ice/throughput/Client.py @@ -40,7 +40,7 @@ class Client(Ice.Application): throughput = Demo.ThroughputPrx.checkedCast(self.communicator().propertyToProxy('Throughput.Throughput')) if not throughput: print args[0] + ": invalid proxy" - return False + return 1 throughputOneway = Demo.ThroughputPrx.uncheckedCast(throughput.ice_oneway()) bytes = [] @@ -190,7 +190,7 @@ class Client(Ice.Application): except KeyboardInterrupt: break - return True + return 0 app = Client() sys.exit(app.main(sys.argv, "config.client")) diff --git a/py/demo/Ice/throughput/Server.py b/py/demo/Ice/throughput/Server.py index 9f03be11d3b..cfedb74b425 100644 --- a/py/demo/Ice/throughput/Server.py +++ b/py/demo/Ice/throughput/Server.py @@ -101,7 +101,7 @@ class Server(Ice.Application): adapter.add(ThroughputI(), self.communicator().stringToIdentity("throughput")) adapter.activate() self.communicator().waitForShutdown() - return True + return 0 app = Server() sys.exit(app.main(sys.argv, "config.server")) diff --git a/py/demo/Ice/value/Client.py b/py/demo/Ice/value/Client.py index f779d014868..f226622e8ce 100644 --- a/py/demo/Ice/value/Client.py +++ b/py/demo/Ice/value/Client.py @@ -33,7 +33,7 @@ class Client(Ice.Application): initial = Demo.InitialPrx.checkedCast(base) if not initial: print args[0] + ": invalid proxy" - return False + return 1 print '\n'\ "Let's first transfer a simple object, for a class without\n"\ @@ -148,7 +148,7 @@ class Client(Ice.Application): initial.shutdown() - return True + return 0 app = Client() sys.exit(app.main(sys.argv, "config.client")) diff --git a/py/demo/Ice/value/Server.py b/py/demo/Ice/value/Server.py index bc1aa5557e4..faa1b81c412 100644 --- a/py/demo/Ice/value/Server.py +++ b/py/demo/Ice/value/Server.py @@ -50,7 +50,7 @@ class Server(Ice.Application): adapter.add(InitialI(adapter), self.communicator().stringToIdentity("initial")) adapter.activate() self.communicator().waitForShutdown() - return True + return 0 app = Server() sys.exit(app.main(sys.argv, "config.server")) diff --git a/py/demo/IceGrid/allocate/Client.py b/py/demo/IceGrid/allocate/Client.py index 8614d638c5f..e1d07675e2b 100644 --- a/py/demo/IceGrid/allocate/Client.py +++ b/py/demo/IceGrid/allocate/Client.py @@ -54,11 +54,11 @@ class SessionKeepAliveThread(threading.Thread): class Client(Ice.Application): def run(self, args): - status = True + status = 0 registry = IceGrid.RegistryPrx.checkedCast(self.communicator().stringToProxy("DemoIceGrid/Registry")) if registry == None: print self.appName() + ": could not contact registry" - return False + return 1 while True: print "This demo accepts any user-id / password combination." @@ -103,10 +103,10 @@ class Client(Ice.Application): break except IceGrid.AllocationException, ex: print self.appName() + ": could not allocate object: " + ex.reason - status = False + status = 1 except: print self.appName() + ": could not allocate object: " + str(sys.exc_info()[0]) - status = False + status = 1 # # Destroy the keepAlive thread and the sesion object otherwise diff --git a/py/demo/IceGrid/sessionActivation/Client.py b/py/demo/IceGrid/sessionActivation/Client.py index 3710280f11d..0bf139e0a37 100644 --- a/py/demo/IceGrid/sessionActivation/Client.py +++ b/py/demo/IceGrid/sessionActivation/Client.py @@ -53,11 +53,11 @@ class SessionKeepAliveThread(threading.Thread): class Client(Ice.Application): def run(self, args): - status = True + status = 0 registry = IceGrid.RegistryPrx.checkedCast(self.communicator().stringToProxy("DemoIceGrid/Registry")) if registry == None: print self.appName() + ": could not contact registry" - return False + return 1 while True: print "This demo accepts any user-id / password combination." @@ -96,13 +96,13 @@ class Client(Ice.Application): break except IceGrid.AllocationException, ex: print self.appName() + ": could not allocate object: " + ex.reason - status = False + status = 1 except IceGrid.ObjectNotRegisteredException: print self.appName() + ": object not registered with registry" - status = False + status = 1 except: print self.appName() + ": could not allocate object: " + str(sys.exc_info()[0]) - status = False + status = 1 # # Destroy the keepAlive thread and the sesion object otherwise diff --git a/py/demo/IceGrid/simple/Client.py b/py/demo/IceGrid/simple/Client.py index 7651802c658..4da93c56a7c 100644 --- a/py/demo/IceGrid/simple/Client.py +++ b/py/demo/IceGrid/simple/Client.py @@ -34,7 +34,7 @@ class Client(Ice.Application): if not hello: print self.appName() + ": couldn't find a `::Demo::Hello' object." - return False + return 1 menu() @@ -58,7 +58,7 @@ class Client(Ice.Application): except KeyboardInterrupt: break - return True + return 0 app = Client() sys.exit(app.main(sys.argv, "config.client")) diff --git a/py/demo/IceStorm/clock/Publisher.py b/py/demo/IceStorm/clock/Publisher.py index d7d140ba2f6..0c243f515ab 100644 --- a/py/demo/IceStorm/clock/Publisher.py +++ b/py/demo/IceStorm/clock/Publisher.py @@ -22,7 +22,7 @@ class Publisher(Ice.Application): opts, args = getopt.getopt(args[1:], '', ['datagram', 'twoway', 'oneway']) except getopt.GetoptError: self.usage() - return False + return 1 datagram = False twoway = False @@ -40,7 +40,7 @@ class Publisher(Ice.Application): if optsSet > 1: self.usage() - return False + return 1 if len(args) > 0: topicName = args[0] @@ -49,7 +49,7 @@ class Publisher(Ice.Application): self.communicator().propertyToProxy('IceStorm.TopicManager.Proxy')) if not manager: print args[0] + ": invalid proxy" - return False + return 1 # # Retrieve the topic. @@ -61,7 +61,7 @@ class Publisher(Ice.Application): topic = manager.create(topicName) except IceStorm.TopicExists, ex: print self.appName() + ": temporary error. try again" - return False + return 1 # # Get the topic's publisher object, and create a Clock proxy with @@ -86,7 +86,7 @@ class Publisher(Ice.Application): # Ignore pass - return True + return 0 app = Publisher() sys.exit(app.main(sys.argv, "config.pub")) diff --git a/py/demo/IceStorm/clock/Subscriber.py b/py/demo/IceStorm/clock/Subscriber.py index f6ca69635a7..6ff4faaf979 100644 --- a/py/demo/IceStorm/clock/Subscriber.py +++ b/py/demo/IceStorm/clock/Subscriber.py @@ -26,7 +26,7 @@ class Subscriber(Ice.Application): opts, args = getopt.getopt(args[1:], '', ['datagram', 'twoway', 'oneway', 'ordered', 'batch']) except getopt.GetoptError: self.usage() - return False + return 1 topicName = "time" datagram = False @@ -51,7 +51,7 @@ class Subscriber(Ice.Application): if batch and (twoway or ordered): print self.appName() + ": batch can only be set with oneway or datagram" - return False + return 1 if optsSet > 1: self.usage() @@ -64,7 +64,7 @@ class Subscriber(Ice.Application): self.communicator().propertyToProxy('IceStorm.TopicManager.Proxy')) if not manager: print args[0] + ": invalid proxy" - return False + return 1 # # Retrieve the topic. @@ -76,7 +76,7 @@ class Subscriber(Ice.Application): topic = manager.create(topicName) except IceStorm.TopicExists, ex: print self.appName() + ": temporary error. try again" - return False + return 1 adapter = self.communicator().createObjectAdapter("Clock.Subscriber") @@ -116,7 +116,7 @@ class Subscriber(Ice.Application): # topic.unsubscribe(subscriber) - return True + return 0 app = Subscriber() sys.exit(app.main(sys.argv, "config.sub")) |