Changeset 1387
- Timestamp:
- 09/29/06 19:26:55
- Files:
-
- trunk/cherrypy/_cprequest.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cprequest.py
r1386 r1387 149 149 150 150 def find_handler(self, path): 151 """Find the appropriate page handler for the given path.""" 151 """Return the appropriate page handler, plus any virtual path. 152 153 This will return two objects. The first will be a callable, 154 which can be used to generate page output. Any parameters from 155 the query string or request body will be sent to that callable 156 as keyword arguments. 157 158 The callable is found by traversing the application's tree, 159 starting from cherrypy.request.app.root, and matching path 160 components to successive objects in the tree. For example, the 161 URL "/path/to/handler" might return root.path.to.handler. 162 163 The second object returned will be a list of names which are 164 'virtual path' components: parts of the URL which are dynamic, 165 and were not used when looking up the handler. 166 These virtual path components are passed to the handler as 167 positional arguments. 168 """ 152 169 request = cherrypy.request 153 170 app = request.app … … 161 178 if "/" in app.config: 162 179 nodeconf.update(app.config["/"]) 163 object_trail = [ ('root', root, nodeconf, curpath)]180 object_trail = [['root', root, nodeconf, curpath]] 164 181 165 182 node = root … … 181 198 nodeconf.update(app.config[curpath]) 182 199 183 object_trail.append( (objname, node, nodeconf, curpath))200 object_trail.append([name, node, nodeconf, curpath]) 184 201 185 202 def set_conf(): … … 208 225 # Insert any extra _cp_config from the default handler. 209 226 conf = getattr(defhandler, "_cp_config", {}) 210 object_trail.insert(i+1, ("default", defhandler, conf, curpath))227 object_trail.insert(i+1, ["default", defhandler, conf, curpath]) 211 228 request.config = set_conf() 212 229 request.is_index = False

