5
from Pyro.errors import PyroError
8
if not Pyro.config.PYRO_MOBILE_CODE:
9
print "\nWARNING: PYRO_MOBILE_CODE not enabled\n"
10
if Pyro.config.PYRO_XML_PICKLE=='gnosis' and Pyro.config.PYRO_GNOSIS_PARANOIA>=0:
11
print "\nWARNING: Using gnosis xml pickle but PYRO_GNOSIS_PARANOIA needs to be -1\n"
13
class Test(Pyro.core.ObjBase):
15
Pyro.core.ObjBase.__init__(self)
16
def method1(self, argument):
17
print "method1 called on test class, arg=",argument
19
obj=Pyro.core.getProxyForURI("PYRONAME://:testmobile_passon_server2")
20
print "calling method on server2, passing on argument"
21
result="Server1 result;"
22
result+=obj.method2(argument)
24
print "Some error occured!",x
25
result="there was an error in server1, see the console over there"
26
print "returning result:",result
29
Pyro.core.initServer()
30
Pyro.core.initClient()
31
ns=Pyro.naming.NameServerLocator().getNS()
32
daemon = Pyro.core.Daemon()
33
daemon.useNameServer(ns)
34
objectName=':testmobile_passon_server1'
35
uri=daemon.connect(Test(),objectName)
37
# enter the service loop.
38
print 'Server1 is ready for customers.'