Changeset 985
- Timestamp:
- 03/01/06 09:20:19
- Files:
-
- trunk/cherrypy/filters/__init__.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/filters/__init__.py
r947 r985 36 36 _output_methods = ['before_finalize', 'on_end_resource', 'on_end_request', 37 37 'before_error_response', 'after_error_response'] 38 39 _old_input_methods = ['onStartResource', 'beforeRequestBody', 'beforeMain'] 40 _old_output_methods = ['beforeFinalize', 'onEndResource', 'onEndRequest', 41 'beforeErrorResponse', 'afterErrorResponse'] 38 42 39 43 backward_compatibility_dict = { … … 77 81 78 82 # Transform the instance lists into a dict of methods 83 # in 2.2 we check the old camelCase filter names first 84 # to provide backward compatibility with 2.1 79 85 _filterhooks.clear() 80 for name in _input_methods:81 _filterhooks[n ame] = []86 for old_name, new_name in zip(_old_input_methods, _input_methods): 87 _filterhooks[new_name] = [] 82 88 for f in inputs: 83 method = getattr(f, name, None)89 method = getattr(f, old_name, None) 84 90 if method: 85 _filterhooks[name].append(method) 86 for name in _output_methods: 87 _filterhooks[name] = [] 91 _filterhooks[new_name].append(method) 92 else: 93 method = getattr(f, new_name, None) 94 if method: 95 _filterhooks[new_name].append(method) 96 for old_name, new_name in zip(_old_output_methods, _output_methods): 97 _filterhooks[new_name] = [] 88 98 for f in outputs: 89 method = getattr(f, name, None)99 method = getattr(f, old_name, None) 90 100 if method: 91 _filterhooks[name].append(method) 101 _filterhooks[new_name].append(method) 102 else: 103 method = getattr(f, new_name, None) 104 if method: 105 _filterhooks[new_name].append(method) 92 106 93 107

