File: server.py

package info (click to toggle)
pyro 1%3A3.14-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,048 kB
  • ctags: 1,988
  • sloc: python: 11,194; xml: 128; sh: 52; makefile: 28
file content (37 lines) | stat: -rw-r--r-- 850 bytes parent folder | download | duplicates (4)
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
36
37
#!/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')