Changeset 106
- Timestamp:
- 08/18/06 17:16:00
- Files:
-
- modpython_gateway.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modpython_gateway.py
r95 r106 171 171 172 172 173 startup = None 173 174 cleanup = None 174 175 175 176 def handler(req): 177 # Run a startup function if requested. 178 global startup 179 if not startup: 180 func = req.get_options().get('wsgi.startup') 181 if func: 182 module_name, object_str = func.split('::', 1) 183 module = __import__(module_name, globals(), locals(), ['']) 184 startup = apache.resolve_object(module, object_str) 185 startup(req) 186 176 187 # Register a cleanup function if requested. 177 188 global cleanup … … 181 192 module_name, object_str = func.split('::', 1) 182 193 module = __import__(module_name, globals(), locals(), ['']) 183 object= apache.resolve_object(module, object_str)194 cleanup = apache.resolve_object(module, object_str) 184 195 def cleaner(data): 185 object()196 cleanup() 186 197 try: 187 198 # apache.register_cleanup wasn't available until 3.1.4.
