Ticket #4: #4.patch
-
Tutorial/tutorial07.py
old new 32 32 index = cpg.expose(index) 33 33 34 34 35 def default(self ):35 def default(self, person): 36 36 # Here we react depending on the virtualPath -- the part of the 37 37 # path that could not be mapped to an object method. In a real 38 38 # application, we would probably do some database lookups here 39 39 # instead of the silly if/elif/else construct. 40 if cpg.request.virtualPath== 'remi':40 if person == 'remi': 41 41 out = "Remi Delon, CherryPy lead developer" 42 elif cpg.request.virtualPath== 'hendrik':42 elif person == 'hendrik': 43 43 out = "Hendrik Mans, CherryPy co-developer & crazy German" 44 elif cpg.request.virtualPath== 'lorenzo':44 elif person == 'lorenzo': 45 45 out = "Lorenzo Lamas, famous actor and singer!" 46 46 else: 47 47 out = "Unknown user. :-(" -
CherryPy/_cpHTTPTools.py
old new 416 416 417 417 cpg.request.objectPath = myPath 418 418 cpg.request.virtualPath = cpg.request.path[len(myPath)-1:] 419 cpg.response.body = func(* *(cpg.request.paramMap))419 cpg.response.body = func(*(cpg.request.virtualPath.split('/')), **(cpg.request.paramMap)) 420 420 421 421 _cpUtil.getSpecialFunction('_cpInitResponse')() 422 422

