4
# The server that doesn't use the Name Server.
9
from Pyro.errors import PyroError
10
import serverparams.parameters
12
if not Pyro.config.PYRO_MOBILE_CODE:
13
print "\nWARNING: PYRO_MOBILE_CODE not enabled\n"
14
if Pyro.config.PYRO_XML_PICKLE=='gnosis' and Pyro.config.PYRO_GNOSIS_PARANOIA>=0:
15
print "\nWARNING: Using gnosis xml pickle but PYRO_GNOSIS_PARANOIA needs to be -1\n"
17
class Test(Pyro.core.ObjBase):
19
Pyro.core.ObjBase.__init__(self)
20
def method(self, argument):
21
print "some method called on test class, arg=",argument
22
print "calling method on the passed object..."
24
# create object of a type that that client does not know about,
25
# so Pyro's mobile code featuer will also pass the (module)code
27
return serverparams.parameters.ServerResult("server arg")
29
Pyro.core.initServer()
30
daemon = Pyro.core.Daemon()
31
objectName='testmobile.bothways'
32
uri=daemon.connect(Test(),objectName)
34
# enter the service loop.
35
print 'Server is ready for customers. I am not using the Name Server.'
36
print 'Object name is:',objectName
37
print 'The URI is: ',uri