Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import Pyro.core
|
||||
import Pyro.naming
|
||||
|
||||
# create instance that will return upper case
|
||||
class StringInstance(Pyro.core.ObjBase):
|
||||
def makeUpper(self, data):
|
||||
return data.upper()
|
||||
|
||||
class MathInstance(Pyro.core.ObjBase):
|
||||
def div(self, num1, num2):
|
||||
return num1/num2
|
||||
|
||||
if __name__ == '__main__':
|
||||
server = Pyro.core.Daemon()
|
||||
name_server = Pyro.naming.NameServerLocator().getNS()
|
||||
server.useNameServer(name_server)
|
||||
server.connect(StringInstance(), 'string')
|
||||
server.connect(MathInstance(), 'math')
|
||||
try:
|
||||
server.requestLoop()
|
||||
except KeyboardInterrupt:
|
||||
print 'Exiting...'
|
||||
server.shutdown()
|
||||
Loading…
Add table
Add a link
Reference in a new issue