4
# The server that doesn't use the Name Server.
9
from Pyro.errors import PyroError
13
if not Pyro.config.PYRO_MOBILE_CODE:
14
print "\nWARNING: PYRO_MOBILE_CODE not enabled\n"
15
if Pyro.config.PYRO_XML_PICKLE=='gnosis' and Pyro.config.PYRO_GNOSIS_PARANOIA>=0:
16
print "\nWARNING: Using gnosis xml pickle but PYRO_GNOSIS_PARANOIA needs to be -1\n"
18
class Test(Pyro.core.ObjBase):
20
Pyro.core.ObjBase.__init__(self)
21
def method(self, argument):
22
print "some method called on test class, arg=",argument
23
# returning an answer object
24
result=answers.answer.Answer("some answer")
25
print "returning",result
28
Pyro.core.initServer()
29
daemon = Pyro.core.Daemon()
30
objectName='testmobile.imports'
31
uri=daemon.connect(Test(),objectName)
33
# enter the service loop.
34
print 'Server is ready for customers. I am not using the Name Server.'
35
print 'Object name is:',objectName
36
print 'The URI is: ',uri