Changeset 1198
- Timestamp:
- 07/10/06 23:15:39
- Files:
-
- trunk/cherrypy/lib/caching.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/caching.py
r1189 r1198 152 152 return wrapper 153 153 154 def _wrapper(): 155 if get(): 156 cherrypy.request.handler = None 157 else: 158 # Note the devious technique here of adding hooks on the fly 159 cherrypy.request.hooks.attach('before_finalize', tee_output) 160 154 161 def _setup(): 155 162 """Hook caching into cherrypy.request using the given conf.""" … … 157 164 if not getattr(cherrypy, "_cache", None): 158 165 init(conf.get("class", None)) 159 def wrapper(): 160 if get(): 161 cherrypy.request.handler = None 162 else: 163 # Note the devious technique here of adding hooks on the fly 164 cherrypy.request.hooks.attach('before_finalize', tee_output) 165 cherrypy.request.hooks.attach('before_main', wrapper) 166 cherrypy.request.hooks.attach('before_main', _wrapper) 166 167

