/usr/share/zope/Products/ReplaceSupport/Handlers/__init__.py is in zope-replacesupport 1.0.3-6.
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 36 37 38 39 40 41 42 43 | # ReplaceSupport 1.0.3
# (c) 2000-2005, Stefan H. Holek, stefan@epy.co.at
# http://zope.org/Members/shh/ReplaceSupport
# License: ZPL
# Zope: 2.6-2.8
__doc__ = 'ReplaceHandler registry'
__version__ = '0.2.0'
class HandlerRegistry:
'''Handler registry'''
def __init__( self ):
self._handlers = {}
def getHandler( self, metatype ):
try: return self._handlers[metatype]
except: return None
def registerHandler( self, handler ):
self._handlers[handler.getMetaType()] = handler
def getHandlerMetaTypes( self ):
keys = self._handlers.keys()
keys.sort()
return keys
reg = HandlerRegistry()
from Globals import package_home
import os
handlers = os.listdir( package_home(globals()) )
handlers = filter( lambda x: x[-3:] == '.py' and x[:1] != '_', handlers )
handlers = map( lambda x: x[:-3], handlers )
for module in handlers:
exec 'from %s import %s' % (module, '__handler_class_name__')
exec 'from %s import %s' % (module, __handler_class_name__)
reg.registerHandler( eval('%s()' % __handler_class_name__) )
from Products.ReplaceSupport.ReplaceSupport import ReplaceSupport
ReplaceSupport._ReplaceHandlerRegistry = reg
|