File: ReplaceHandler.py

package info (click to toggle)
zope-replacesupport 1.0.2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 168 kB
  • ctags: 155
  • sloc: python: 743; makefile: 38; sh: 25
file content (43 lines) | stat: -rw-r--r-- 1,176 bytes parent folder | download
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
38
39
40
41
42
43
# ReplaceSupport 1.0.2
# (c) 2000-2004, Stefan H. Holek, stefan@epy.co.at
# http://zope.org/Members/shh/ReplaceSupport
# License: ZPL
# Zope: 2.3-2.7

__doc__ = 'ReplaceHandler base class'
__version__ = '0.2.0'

# *must* set this attribute to the respective handler's class 
# name in each handler module
#
__handler_class_name__ = 'Must override!'

# derive your own handler class from this one
#
class ReplaceHandler:
	'''replace handler base class'''

	def getMetaType( self ):
		'''returns the target object's metatype as string'''
		return ''

	def getChangePermission( self ):
		'''returns the permission required to change the object (string).
		   modification is disallowed by default so you must override'''
		return ''

	def getBody( self, ob ):
		'''returns the target object's body as string'''
		return ''

	def getParams( self, ob ):
		'''returns the target object's parameters as string.
		   no need to override if the object at hand does not 
		   have a parameters attribute'''
		return ''
	
	def manageEdit( self, ob, body, params='' ):
		'''implements the changing of the target object's body
		   (and parameters). typically calls manage_edit'''
		pass