/usr/share/doc/pyro/examples/attributes/server.py is in pyro-examples 1:3.14-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #!/usr/bin/env python
import sys, os
import Pyro.core
from Person import Person
sys.path.insert(0,os.pardir) # to find testserver.py
import testserver
######## testclass object (subclassed from ObjBase)
class testclass(Pyro.core.ObjBase):
def __init__(self):
Pyro.core.ObjBase.__init__(self)
self.sum=0
self.changedby=''
# the following only works because Person is in a separate module
# that is also available to the client:
self.person=Person("Irmen de Jong","30")
######## testclass object (standalone - delegate approach)
class testclass2(object):
def __init__(self):
self.sum=0
self.changedby=''
# the following only works because Person is in a separate module
# that is also available to the client:
self.person=Person("Irmen de Jong","30")
######## main program
testserver.start(testclass,'attributes')
|