Changeset 1417
- Timestamp:
- 10/28/06 10:31:33
- Files:
-
- trunk/cherrypy/_cpdispatch.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cpdispatch.py
r1398 r1417 206 206 """A Routes based dispatcher for CherryPy.""" 207 207 208 def __init__(self): 208 def __init__(self, full_result=False): 209 """ 210 Routes dispatcher 211 212 Set full_result to True if you wish the controller 213 and the action to be passed on to the page handler 214 parameters. By default they won't be. 215 """ 209 216 import routes 217 self.full_result = full_result 210 218 self.controllers = {} 211 219 self.mapper = routes.Mapper() … … 245 253 result = self.mapper.match(path_info) 246 254 config.mapper_dict = result 247 request.params.update(result or {}) 255 params = {} 256 if result: 257 params = result.copy() 258 if not self.full_result: 259 params.pop('controller', None) 260 params.pop('action', None) 261 request.params.update(params) 248 262 249 263 # Get config for the root object/path. … … 270 284 last = None 271 285 for atom in atoms: 272 curpath = "/".join((curpath, name))286 curpath = "/".join((curpath, atom)) 273 287 if curpath in app.config: 274 288 merge(app.config[curpath])

