Changeset 1078
- Timestamp:
- 04/26/06 17:51:55
- Files:
-
- trunk/cherrypy/_cprequest.py (modified) (2 diffs)
- trunk/cherrypy/_cputil.py (modified) (1 diff)
- trunk/cherrypy/lib/encodings.py (modified) (1 diff)
- trunk/cherrypy/test/test_static_filter.py (modified) (1 diff)
- trunk/cherrypy/tools.py (modified) (3 diffs)
- trunk/cherrypy/tutorial/tut07_sessions.py (modified) (1 diff)
- trunk/cherrypy/tutorial/tutorial.conf (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cprequest.py
r1075 r1078 230 230 """Find and run the appropriate page handler.""" 231 231 request = cherrypy.request 232 handler, opath, vpath = find (path)232 handler, opath, vpath = find_handler(path) 233 233 234 234 # Remove "root" from opath and join it to get found_object_path … … 243 243 cherrypy.response.body = handler(*vpath, **request.params) 244 244 245 def find(objectpath): 245 def find_handler(objectpath): 246 """Find the appropriate page handler for the given path.""" 246 247 objectTrail = _cputil.get_object_trail(objectpath) 247 248 names = [name for name, candidate in objectTrail] trunk/cherrypy/_cputil.py
r1072 r1078 48 48 # Convert the list of names into a list of objects 49 49 node = root 50 objectTrail = [ ]50 objectTrail = [('root', root)] 51 51 for name in nameList: 52 52 # maps virtual names to Python identifiers (replaces '.' with '_') trunk/cherrypy/lib/encodings.py
r1053 r1078 1 1 import struct 2 2 import time 3 import zlib4 3 5 4 import cherrypy trunk/cherrypy/test/test_static_filter.py
r1056 r1078 109 109 self.getPage("/error/thing.html") 110 110 self.assertErrorPage(500) 111 self.assertInBody("TypeError: get_dir() takes at least 2 "111 self.assertInBody("TypeError: staticdir() takes at least 2 " 112 112 "non-keyword arguments (1 given)") 113 113 trunk/cherrypy/tools.py
r1076 r1078 281 281 if not hasattr(cherrypy, "session"): 282 282 cherrypy.session = _sessions.SessionWrapper() 283 cherrypy.request.hooks.attach(' on_start_resource', init)283 cherrypy.request.hooks.attach('before_request_body', init) 284 284 285 285 cherrypy.request.hooks.attach('before_finalize', _sessions.save) … … 302 302 dispatch = tools.xmlrpc.dispatch 303 303 """ 304 request = cherrypy.request 304 305 request.hooks.attach('after_error_response', _xmlrpc.wrap_error) 305 306 … … 308 309 309 310 from cherrypy import _cprequest 310 handler, opath, vpath = _cprequest.find (path)311 handler, opath, vpath = _cprequest.find_handler(path) 311 312 312 313 # Decode any leftover %2F in the virtual_path atoms. 313 314 vpath = tuple([x.replace("%2F", "/") for x in vpath]) 314 315 315 request = cherrypy.request316 316 body = handler(*(vpath + rpcparams), **request.params) 317 317 conf = tool_config().get("xmlrpc", {}) trunk/cherrypy/tutorial/tut07_sessions.py
r1070 r1078 2 2 Tutorial - Sessions 3 3 4 Storing session data in CherryPy applications is very easy: cherrypy .request5 provides a dictionary called sessionMapthat represents the session4 Storing session data in CherryPy applications is very easy: cherrypy 5 provides a dictionary called "session" that represents the session 6 6 data for the current user. If you use RAM based sessions, you can store 7 7 any kind of object into that dictionary; otherwise, you are limited to trunk/cherrypy/tutorial/tutorial.conf
r650 r1078 1 1 [global] 2 server.socket Port = 80803 server.thread Pool = 102 server.socket_port = 8080 3 server.thread_pool = 10 4 4 server.environment = "production" 5 5 # server.showTracebacks = True

